[RESOLVED] Nested Function References

admin

Administrator
Staff member
Hi,

I get a parse error trying to call this code:

$this→getContext()→getDatabaseConnection();

Is there an ini setting that I need to be able to call nested functions ??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(){}
}ok that answers one question:

In theory then this should be parsable: $this→getContext()→getDatabaseConnection();Yes it should be, what error do you get?Unbelievable - parse error - due to the copy and paste of these little beauties:

→ should be ->

RossC0 hangs his head in shame... :o

---
edit wheres the resolve flag gone ?:eek: where were you copy-pasting from?!

Resolved flag? Under the Thread Tools dropdown, top o' the thread.Some stupid wiki!

Thanks for the heads up!
 
Back
Top