ID: 40263 Updated by: [EMAIL PROTECTED] Reported By: jbailey at raspberryginger dot com -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: Linux PHP Version: Irrelevant New Comment:
echo $a->{$b->a} Previous Comments: ------------------------------------------------------------------------ [2007-01-28 15:51:31] jbailey at raspberryginger dot com Description: ------------ There is no way of doing $a->$b->a where I really want $a->($b->a) Reproduce code: --------------- class a {} class b {} $a = new a(); $b = new b(); $a->foo = "foo"; $a->bar = "bar"; $b->a = "foo"; $b->b = "bar"; $temp=$b->a; echo $a->$temp; echo $a->($b->a); Expected result: ---------------- The lines: echo $a->$temp; echo $a->($b->a); should each output the same thing. Actual result: -------------- Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '{' or '$' in /tmp/test.php on line 18 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40263&edit=1