3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array( array("PROPERTIES" => array(1122), "QUANTITY" => "11"), array("PROPERTIES" => array(1123), "QUANTITY" => "12") ); function getQuantityById($id) { global $arr; foreach ($arr as $item) { if ($item["PROPERTIES"][0] == $id) return $item["QUEANTITY"]; } return null; } echo getQuantityById(1122);
Output for 5.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined index: QUEANTITY in /in/a9kQv on line 11
Output for 4.3.0 - 5.2.17
Notice: Undefined index: QUEANTITY in /in/a9kQv on line 11