3v4l.org

run code in 300+ PHP versions simultaneously
<?php $products = (object)array("chemID"=> 1, "catID" => 1),array("chemID"=> 2, "catID" => 1); $carts = (object)array("chemID"=> 1, "catID" => 4),array("chemID"=> 2, "catID" => 4), array("chemID"=> 2, "catID" => 1); var_dump($products); foreach($products as $key) { foreach($key as $value) { echo $key . ' ' . $value; } }
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.15
Parse error: syntax error, unexpected ',' in /in/S9ZcZ on line 3
Process exited with code 255.

preferences:
165.34 ms | 1395 KiB | 22 Q