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