3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class x { function foo() { print "foo"; } function bar() { $x = array(get_class(), "self::foo"); $x(); } } $a = new x; $a->bar();
based on L86ea
Output for 7.0.0 - 7.1.0
Fatal error: Uncaught Error: Call to undefined method x::self::foo() in /in/CfFch:8 Stack trace: #0 /in/CfFch(12): x->bar() #1 {main} thrown in /in/CfFch on line 8
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Call to undefined method x::self::foo() in /in/CfFch on line 8
Process exited with code 255.
Output for 5.0.0 - 5.3.29
Fatal error: Function name must be a string in /in/CfFch on line 8
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: Wrong parameter count for get_class() in /in/CfFch on line 7 Notice: Array to string conversion in /in/CfFch on line 8 Fatal error: Call to undefined function: array() in /in/CfFch on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Warning: Wrong parameter count for get_class() in /in/CfFch on line 7 Notice: Array to string conversion in /in/CfFch on line 8 Fatal error: Call to undefined function: array() in /in/CfFch on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Wrong parameter count for get_class() in /in/CfFch on line 7 Notice: Array to string conversion in /in/CfFch on line 8 Fatal error: Call to undefined function: array() in /in/CfFch on line 8