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, "\n"); foreach($dataset as $key => $val) { $dataset[$key] = foo($val, 'bar'); var_dump($dataset[$key], $key, $val, "\n"); }
Output for 4.3.0 - 7.1.0
array(3) { [0]=> bool(false) [1]=> bool(false) ["c"]=> string(5) "three" } string(1) " " bool(false) int(0) bool(false) string(1) " " bool(false) int(1) bool(false) string(1) " " bool(false) string(1) "c" string(5) "three" string(1) " "