3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function ptr2str($ptr) { $out = ""; for ($i = 0; $i < 8; $i++) { $out .= chr($ptr & 0xff); $ptr >>= 8; } return $out; } class obj { function __tostring() { global $arr; $arr = 1; for ($i = 0; $i < 5; $i++) { $v[$i] = 'hi'.$i; } return 'hi'; } } $arr = array('string' => new obj); array_walk_recursive($arr, 'settype');
based on n5E2r
Output for 7.1.0 - 7.2.0
Warning: array_walk_recursive(): Iterated value is no longer an array or object in /in/WY0pB on line 27
Output for 7.0.0 - 7.0.20

Process exited with code 139.
Output for 5.4.10 - 5.6.28
Warning: settype(): Invalid type in /in/WY0pB on line 27 Warning: settype(): Invalid type in /in/WY0pB on line 27 Warning: settype(): Invalid type in /in/WY0pB on line 27 Warning: settype(): Invalid type in /in/WY0pB on line 27
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Warning: settype(): Invalid type in /in/WY0pB on line 27 Warning: settype(): Invalid type in /in/WY0pB on line 27 Warning: settype(): Invalid type in /in/WY0pB on line 27 Warning: settype(): Invalid type in /in/WY0pB on line 27