3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $_POST = array("person" => array( 1 => array("id" => 1, "name" => "bob"), 2 => array("id" => 2, "name" => "jim") ) ); foreach ($_POST as $dataSet) { foreach ($dataSet as $person) { foreach ($person as $field => $value) { if ( $person["id"] == 1) { echo $person["name"],"\n"; } } } } foreach ($_POST as $dataSet) { foreach ($dataSet as $person) { foreach ($person as $field => $value) { if ( $value == 1) { echo "\n",$person["name"],"\n"; } } } }
Output for 5.6.0 - 5.6.30, hhvm-3.18.4 - 3.21.0, 7.0.0 - 7.3.0rc3
bob bob bob