3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $dataset = array("a" > "one", "b" > "two", "c" => "three"); function foo($a, $b) { return false; } var_dump($dataset); print(PHP_EOL); foreach($dataset as $key => $val) { $dataset[$key] = foo($val, 'bar'); var_dump($dataset[$key], $key, $val); print(PHP_EOL); } var_dump($dataset); print(PHP_EOL);
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
array(3) { [0]=> bool(false) [1]=> bool(false) ["c"]=> string(5) "three" } bool(false) int(0) bool(false) bool(false) int(1) bool(false) bool(false) string(1) "c" string(5) "three" array(3) { [0]=> bool(false) [1]=> bool(false) ["c"]=> bool(false) }
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
array(3) { [0]=> bool(false) [1]=> bool(false) ["c"]=> string(5) "three" } Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VINCS on line 10 PHP_EOLbool(false) int(0) bool(false) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VINCS on line 15 PHP_EOLbool(false) int(1) bool(false) Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VINCS on line 15 PHP_EOLbool(false) string(1) "c" string(5) "three" Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VINCS on line 15 PHP_EOLarray(3) { [0]=> bool(false) [1]=> bool(false) ["c"]=> bool(false) } Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VINCS on line 20 PHP_EOL