3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $data = array ( 'prd' => array ( 0 => '1', 1 => '2', 2 => '3', 3 => '4', 4 => '5', 5 => '6', 6 => '7', 7 => '8', ), 'price' => array ( 0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd', 4 => 'e', 5 => 'f', 6 => 'g', 7 => 'h', ) ); #for ($x = 0; $x< count($data['prd']); $x++) { # echo $data['prd'][$x] . " costs " . $data['price'][$x] . PHP_EOL; #} foreach($data as $key => $val) { echo $key . $val; }
based on Nr2QN
Output for 5.4.0 - 7.2.0
Notice: Array to string conversion in /in/bBifL on line 31 prdArray Notice: Array to string conversion in /in/bBifL on line 31 priceArray
Output for 4.3.0 - 5.3.29
prdArraypriceArray