3v4l.org

run code in 200+ 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 - 7.2.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