#40263 [Opn->Bgs]: Can't set associativity for variable member access.

From: Date: Sun, 28 Jan 2007 16:00:40 +0000
Subject: #40263 [Opn->Bgs]: Can't set associativity for variable member access.
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969375063@lists.php.net to get a copy of this message
ID: 40263 Updated by: cellog@php.net 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

« previous php.doc (#969375063) next »