1--TEST-- 2Acquire callable through various dynamic constructs 3--FILE-- 4<?php 5 6class A { 7 public static function b($x) { 8 return $x; 9 } 10 11 public function c($x) { 12 return $x; 13 } 14} 15 16$name = 'strlen'; 17$fn = $name(...); 18var_dump($fn('x')); 19 20$name = ['A', 'b']; 21$fn = $name(...); 22var_dump($fn(2)); 23 24$name = [new A, 'c']; 25$fn = $name(...); 26var_dump($fn(3)); 27 28$name1 = 'A'; 29$name2 = 'b'; 30$fn = $name1::$name2(...); 31var_dump($fn(4)); 32 33$name2 = 'c'; 34$fn = (new A)->$name2(...); 35var_dump($fn(5)); 36 37$fn = [A::class, 'b'](...); 38var_dump($fn(6)); 39 40$o = new stdClass; 41$o->prop = A::b(...); 42($o->prop)(7); 43 44$nam 45 46?> 47--EXPECT-- 48int(1) 49int(2) 50int(3) 51int(4) 52int(5) 53int(6) 54