What do you mean by nested functions? In PHP 5 the above snippet calls a method getContext() on $this, and getContext() returns a reference to an object with a getDatabaseConnection() method. As far as I know this behaviour is can't be enabled or disabled in PHP 5 (it's not present at all in PHP 4).
However a nested function is a function within a function, e.g.
function myFunction()
{
function myNestedFunction(){}
}