3v4l.org

run code in 300+ PHP versions simultaneously
<?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; }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Warning: Array to string conversion in /in/V07FZ on line 27 1 costs Array Warning: Array to string conversion in /in/V07FZ on line 27 2 costs Array Warning: Array to string conversion in /in/V07FZ on line 27 3 costs Array Warning: Array to string conversion in /in/V07FZ on line 27 4 costs Array Warning: Array to string conversion in /in/V07FZ on line 27 5 costs Array Warning: Array to string conversion in /in/V07FZ on line 27 6 costs Array Warning: Array to string conversion in /in/V07FZ on line 27 7 costs Array Warning: Array to string conversion in /in/V07FZ on line 27 8 costs Array
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.25, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.31, 7.4.0 - 7.4.33
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.3.11, 4.4.0 - 4.4.9, 5.0.2 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 7.3.32 - 7.3.33
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

preferences:
246.42 ms | 403 KiB | 349 Q