1--TEST-- 2In $a->$b[Y](), $b[Y] represents a method name on $a. But in $a->X[Y](), $a->X[Y] represents a global function name. 3--FILE-- 4<?php 5 class C 6 { 7 function foo($a, $b) 8 { 9 echo "Called C::foo($a, $b)\n"; 10 } 11 } 12 13 $c = new C; 14 15 $functions[0] = 'foo'; 16 $functions[1][2][3][4] = 'foo'; 17 18 $c->$functions[0](1, 2); 19 $c->$functions[1][2][3][4](3, 4); 20 21 22 function foo($a, $b) 23 { 24 echo "Called global foo($a, $b)\n"; 25 } 26 27 $c->functions[0] = 'foo'; 28 $c->functions[1][2][3][4] = 'foo'; 29 30 $c->functions[0](5, 6); 31 $c->functions[1][2][3][4](7, 8); 32?> 33--EXPECTF-- 34Called C::foo(1, 2) 35Called C::foo(3, 4) 36Called global foo(5, 6) 37Called global foo(7, 8) 38