1--TEST--
2In $a->$b[Y]() and $a->X[Y]() both $a->$b[Y] and $a->X[Y] represent a global function name
3--FILE--
4<?php
5  class C {
6    public $functions;
7  }
8
9  function foo($a, $b) {
10      echo "Called global foo($a, $b)\n";
11  }
12
13  $name = 'functions';
14
15  $c = new C;
16  $c->functions[0] = 'foo';
17  $c->functions[1][2][3][4] = 'foo';
18
19  $c->$name[0](1, 2);
20  $c->$name[1][2][3][4](3, 4);
21
22  $c->functions[0](5, 6);
23  $c->functions[1][2][3][4](7, 8);
24?>
25--EXPECT--
26Called global foo(1, 2)
27Called global foo(3, 4)
28Called global foo(5, 6)
29Called global foo(7, 8)
30