3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { public function testFunction($arr) { array_walk_recursive($arr, array('ControllerModuleStickyLabels','alt_json_encode_callback')); return mb_decode_numericentity(json_encode($arr), array (0x80, 0xffff, 0, 0xffff), 'UTF-8'); } private function alt_json_encode_callback (&$item, $key) { if (is_string($item)) $item = mb_encode_numericentity($item, array (0x80, 0xffff, 0, 0xffff), 'UTF-8'); } } $a= Test::testFunction(array('1','1')); vardump($a);
Output for 7.0.0 - 7.1.0
Deprecated: Non-static method Test::testFunction() should not be called statically in /in/LTXFN on line 17 Warning: array_walk_recursive() expects parameter 2 to be a valid callback, class 'ControllerModuleStickyLabels' not found in /in/LTXFN on line 6 Fatal error: Uncaught Error: Call to undefined function vardump() in /in/LTXFN:18 Stack trace: #0 {main} thrown in /in/LTXFN on line 18
Process exited with code 255.
Output for 5.3.0 - 5.6.28
Strict Standards: Non-static method Test::testFunction() should not be called statically in /in/LTXFN on line 17 Warning: array_walk_recursive() expects parameter 2 to be a valid callback, class 'ControllerModuleStickyLabels' not found in /in/LTXFN on line 6 Fatal error: Call to undefined function vardump() in /in/LTXFN on line 18
Process exited with code 255.
Output for 5.0.0 - 5.2.17
Strict Standards: Non-static method Test::testFunction() should not be called statically in /in/LTXFN on line 17 Fatal error: Class 'ControllerModuleStickyLabels' not found in /in/LTXFN on line 6
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/LTXFN on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/LTXFN on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/LTXFN on line 5
Process exited with code 255.