Alright, Got the issue here.
It was a mistake of mine, I guess.
The error was not in the above lines, but somehow another variable was rather than accessing the parent php, was accessing the child php directly.
So, guess, it works out now, why the variables were not available.