3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function cmp($a, $b) { return strcmp($a["fruit"], $b["fruit"]); } $fruits[0]["fruit"] = "lemons"; $fruits[1]["fruit"] = "apples"; $fruits[2]["fruit"] = "grapes"; usort($fruits, "cmp"); while (list($key, $value) = each($fruits)) { echo "\$fruits[$key]: " . $value["fruit"] . "\n"; } ?>
based on vns6s
Output for 7.2.0
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /in/ikRWJ on line 14 $fruits[0]: apples $fruits[1]: grapes $fruits[2]: lemons
Output for 5.3.21 - 7.1.10
$fruits[0]: apples $fruits[1]: grapes $fruits[2]: lemons