3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $products = array(array("chemID"=> 1, "catID" => 1),array("chemID"=> 2, "catID" => 1)); $carts = array(array("chemID"=> 1, "catID" => 4),array("chemID"=> 2, "catID" => 4), array("chemID"=> 2, "catID" => 1)); foreach($products as $key->$value) { echo $key; }
based on q5edA
Output for 7.1.0 - 7.2.0
Notice: Undefined variable: value in /in/QWD5L on line 5 Warning: Creating default object from empty value in /in/QWD5L on line 5 Recoverable fatal error: Object of class stdClass could not be converted to string in /in/QWD5L on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: value in /in/QWD5L on line 5 Warning: Creating default object from empty value in /in/QWD5L on line 5 Fatal error: Uncaught Error: Cannot access empty property in /in/QWD5L:5 Stack trace: #0 {main} thrown in /in/QWD5L on line 5
Process exited with code 255.
Output for 5.4.9 - 5.6.28
Notice: Undefined variable: value in /in/QWD5L on line 5 Warning: Creating default object from empty value in /in/QWD5L on line 5 Fatal error: Cannot access empty property in /in/QWD5L on line 5
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Notice: Undefined variable: value in /in/QWD5L on line 5 Strict Standards: Creating default object from empty value in /in/QWD5L on line 5 Fatal error: Cannot access empty property in /in/QWD5L on line 5
Process exited with code 255.