3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private function __construct() { throw new Exception('thrown'); } public function A() { return array('a', 'b', 'c'); } public static function I() { return new A(); } } $instance = new A::I(); $A = call_user_func_array(array($instance, 'A'), array()); print $A[1];
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
Parse error: syntax error, unexpected 'I' (T_STRING), expecting variable (T_VARIABLE) or '$' in /in/Y7E6E on line 21
Process exited with code 255.

preferences:
165.28 ms | 1395 KiB | 22 Q