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'] . PHP_EOL; }
based on Xta2A
Output for 5.4.0 - 7.2.0
Notice: Array to string conversion in /in/V07FZ on line 27 1 costs Array Notice: Array to string conversion in /in/V07FZ on line 27 2 costs Array Notice: Array to string conversion in /in/V07FZ on line 27 3 costs Array Notice: Array to string conversion in /in/V07FZ on line 27 4 costs Array Notice: Array to string conversion in /in/V07FZ on line 27 5 costs Array Notice: Array to string conversion in /in/V07FZ on line 27 6 costs Array Notice: Array to string conversion in /in/V07FZ on line 27 7 costs Array Notice: Array to string conversion in /in/V07FZ on line 27 8 costs Array
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.3.29
1 costs Array 2 costs Array 3 costs Array 4 costs Array 5 costs Array 6 costs Array 7 costs Array 8 costs Array
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/V07FZ on line 27 1 costs ArrayPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/V07FZ on line 27 2 costs ArrayPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/V07FZ on line 27 3 costs ArrayPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/V07FZ on line 27 4 costs ArrayPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/V07FZ on line 27 5 costs ArrayPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/V07FZ on line 27 6 costs ArrayPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/V07FZ on line 27 7 costs ArrayPHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/V07FZ on line 27 8 costs ArrayPHP_EOL