3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array ( array(1, 'Mobiel', 'Apple', '', ''), array(2, 'Mobiel', 'Apple', '', ''), array(3, 'Mobiel', 'Apple', '', ''), array(4, 'Mobiel', 'Apple', '', ''), array(5, 'Mobiel', 'Apple', '', '') ); $cars = array ( array('Volvo', 'BMW', 'Volkswagen'), array('', '', '') ); foreach ($cars as $key->$value) { $data[0][2] = $key->$value; } print_r ($data);
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Warning: Undefined variable $value in /in/uMPfW on line 18 Fatal error: Uncaught Error: Attempt to assign property "" on null in /in/uMPfW:18 Stack trace: #0 {main} thrown in /in/uMPfW on line 18
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: Undefined variable $value in /in/uMPfW on line 18 Fatal error: Uncaught Error: Attempt to assign property "" on null in /in/uMPfW:18 Stack trace: #0 {main} thrown in /in/uMPfW on line 18
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Notice: Undefined variable: value in /in/uMPfW on line 18 Warning: Creating default object from empty value in /in/uMPfW on line 18 Notice: Undefined variable: value in /in/uMPfW on line 19 Notice: Undefined variable: value in /in/uMPfW on line 18 Notice: Undefined variable: value in /in/uMPfW on line 19 Array ( [0] => Array ( [0] => 1 [1] => Mobiel [2] => Array ( [0] => [1] => [2] => ) [3] => [4] => ) [1] => Array ( [0] => 2 [1] => Mobiel [2] => Apple [3] => [4] => ) [2] => Array ( [0] => 3 [1] => Mobiel [2] => Apple [3] => [4] => ) [3] => Array ( [0] => 4 [1] => Mobiel [2] => Apple [3] => [4] => ) [4] => Array ( [0] => 5 [1] => Mobiel [2] => Apple [3] => [4] => ) )
Output for 7.3.32 - 7.3.33, 7.4.26
Warning: Creating default object from empty value in /in/uMPfW on line 18 Array ( [0] => Array ( [0] => 1 [1] => Mobiel [2] => Array ( [0] => [1] => [2] => ) [3] => [4] => ) [1] => Array ( [0] => 2 [1] => Mobiel [2] => Apple [3] => [4] => ) [2] => Array ( [0] => 3 [1] => Mobiel [2] => Apple [3] => [4] => ) [3] => Array ( [0] => 4 [1] => Mobiel [2] => Apple [3] => [4] => ) [4] => Array ( [0] => 5 [1] => Mobiel [2] => Apple [3] => [4] => ) )
Output for 7.0.0 - 7.0.20
Notice: Undefined variable: value in /in/uMPfW on line 18 Warning: Creating default object from empty value in /in/uMPfW on line 18 Fatal error: Uncaught Error: Cannot access empty property in /in/uMPfW:18 Stack trace: #0 {main} thrown in /in/uMPfW on line 18
Process exited with code 255.

preferences:
199.45 ms | 401 KiB | 218 Q