3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { function malzwei($n) { return $n * 2; } function quadrat($n) { return $n * $n; } function getQuadrat() { return $this->quadrat; } } $t = new Test(); echo call_user_func($t->getQuadrat(), 3); var_dump(array_map($t->getQuadrat(), array(1, 2, 3, 4)));
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined property: Test::$quadrat in /in/gv03V on line 5 Warning: call_user_func() expects parameter 1 to be a valid callback, no array or string given in /in/gv03V on line 9 Notice: Undefined property: Test::$quadrat in /in/gv03V on line 5 array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) }
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined property: Test::$quadrat in /in/gv03V on line 5 Warning: Invalid argument: function: not string, closure, or array in /in/gv03V on line 9 Notice: Undefined property: Test::$quadrat in /in/gv03V on line 5 array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) }
Output for 5.2.6 - 5.2.17
Notice: Undefined property: Test::$quadrat in /in/gv03V on line 5 Warning: call_user_func(): First argument is expected to be a valid callback in /in/gv03V on line 9 Notice: Undefined property: Test::$quadrat in /in/gv03V on line 5 array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) }
Output for 5.0.0 - 5.2.5
Notice: Undefined property: Test::$quadrat in /in/gv03V on line 5 Warning: call_user_func(): First argument is expected to be a valid callback in /in/gv03V on line 9 Notice: Undefined property: Test::$quadrat in /in/gv03V on line 5 array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) }
Output for 4.3.2 - 4.4.9
Notice: Undefined property: quadrat in /in/gv03V on line 5 Warning: call_user_func(): First argument is expected to be a valid callback in /in/gv03V on line 9 Notice: Undefined property: quadrat in /in/gv03V on line 5 array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) }
Output for 4.3.0 - 4.3.1
Notice: Undefined property: quadrat in /in/gv03V on line 5 Warning: call_user_func() [http://www.php.net/function.call-user-func]: First argument is expected to be a valid callback in /in/gv03V on line 9 Notice: Undefined property: quadrat in /in/gv03V on line 5 array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) }