3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = []; for ($i = 0; $i < 5; ++$i) { if ($i == 2) { continue; } print "$i\n"; $arr[] = $i; $count++; $i[number]; } var_dump($arr);
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
0 Warning: Undefined variable $count in /in/f6EY2 on line 9 Fatal error: Uncaught Error: Undefined constant "number" in /in/f6EY2:10 Stack trace: #0 {main} thrown in /in/f6EY2 on line 10
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 0 Warning: Undefined variable $count in /in/f6EY2 on line 9 Fatal error: Uncaught Error: Undefined constant "number" in /in/f6EY2:10 Stack trace: #0 {main} thrown in /in/f6EY2 on line 10
Process exited with code 255.
Output for 7.4.12 - 7.4.33
0 Notice: Undefined variable: count in /in/f6EY2 on line 9 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 Notice: Trying to access array offset on value of type int in /in/f6EY2 on line 10 1 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 Notice: Trying to access array offset on value of type int in /in/f6EY2 on line 10 3 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 Notice: Trying to access array offset on value of type int in /in/f6EY2 on line 10 4 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 Notice: Trying to access array offset on value of type int in /in/f6EY2 on line 10 array(4) { [0]=> int(0) [1]=> int(1) [2]=> int(3) [3]=> int(4) }
Output for 7.3.32 - 7.3.33
0 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 1 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 3 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 4 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 array(4) { [0]=> int(0) [1]=> int(1) [2]=> int(3) [3]=> int(4) }
Output for 7.2.6, 7.3.24 - 7.3.31
0 Notice: Undefined variable: count in /in/f6EY2 on line 9 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 1 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 3 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 4 Warning: Use of undefined constant number - assumed 'number' (this will throw an Error in a future version of PHP) in /in/f6EY2 on line 10 array(4) { [0]=> int(0) [1]=> int(1) [2]=> int(3) [3]=> int(4) }

preferences:
145.64 ms | 403 KiB | 116 Q