3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function html($value) { return htmlentities($value); } class Foo { function html($value) { return htmlentities($value); } } $value = '123'; $obect = new Foo(); htmlentities($value); html($value); $object->$func($value); call_user_func($func, $value); call_user_func(array($object, $func), $value); call_user_func_array($func, array($value)); call_user_func_array(array($object, $func), array($value));
based on TBMW0
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: func in /in/0X3oP on line 22 Fatal error: Uncaught Error: Method name must be a string in /in/0X3oP:22 Stack trace: #0 {main} thrown in /in/0X3oP on line 22
Process exited with code 255.
Output for 5.1.0 - 5.6.28
Notice: Undefined variable: func in /in/0X3oP on line 22 Fatal error: Method name must be a string in /in/0X3oP on line 22
Process exited with code 255.
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: func in /in/0X3oP on line 22 Notice: Undefined variable: object in /in/0X3oP on line 22 Fatal error: Method name must be a string in /in/0X3oP on line 22
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: func in /in/0X3oP on line 22 Notice: Undefined variable: object in /in/0X3oP on line 22 Fatal error: Method name must be a string in /in/0X3oP on line 22
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Notice: Undefined variable: func in /in/0X3oP on line 22 Fatal error: Call to a member function on a non-object in /in/0X3oP on line 22
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: func in /in/0X3oP on line 22 Fatal error: Call to a member function on a non-object in /in/0X3oP on line 22