3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function sayHello(){ echo "Hello"; } } $res = ["A", "sayHello"]; function INeedYou(callcable $callable) { echo $callable(); } INeedYou($res);
based on qREsH
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to INeedYou() must be an instance of callcable, array given, called in /in/gA1ak on line 13 and defined in /in/gA1ak:9 Stack trace: #0 /in/gA1ak(13): INeedYou(Array) #1 {main} thrown in /in/gA1ak on line 9
Process exited with code 255.
Output for 5.4.2 - 5.6.21
Catchable fatal error: Argument 1 passed to INeedYou() must be an instance of callcable, array given, called in /in/gA1ak on line 13 and defined in /in/gA1ak on line 9
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/gA1ak on line 7
Process exited with code 255.