3v4l.org

run code in 300+ PHP versions simultaneously
<?php for($f=file(__FILE__),$i=0;$i<10;$i++) { echo $f[$i]; } $l=0; foreach($_SERVER as $s) { if ($s=='ROZWAL') $l++; } echo(l); if ($l!=40) { die(); }
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.7
<?php for($f=file(__FILE__),$i=0;$i<10;$i++) { echo $f[$i]; } $l=0; foreach($_SERVER as $s) { if ($s=='ROZWAL') $l++; } echo(l); if ($l!=40) { Fatal error: Uncaught Error: Undefined constant "l" in /in/r5HZv:9 Stack trace: #0 {main} thrown in /in/r5HZv on line 9
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
<?php for($f=file(__FILE__),$i=0;$i<10;$i++) { echo $f[$i]; } $l=0; foreach($_SERVER as $s) { if ($s=='ROZWAL') $l++; } echo(l); if ($l!=40) { Warning: Use of undefined constant l - assumed 'l' (this will throw an Error in a future version of PHP) in /in/r5HZv on line 9 l
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20
<?php for($f=file(__FILE__),$i=0;$i<10;$i++) { echo $f[$i]; } $l=0; foreach($_SERVER as $s) { if ($s=='ROZWAL') $l++; } echo(l); if ($l!=40) { Notice: Use of undefined constant l - assumed 'l' in /in/r5HZv on line 9 l

preferences:
192.59 ms | 403 KiB | 227 Q