3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myTest() { static $x = 0; echo $x; $x++; } For ($i=0;$i<=40;$i++){ print '/n/r'; myTest(); } ?>
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 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
/n/r0/n/r1/n/r2/n/r3/n/r4/n/r5/n/r6/n/r7/n/r8/n/r9/n/r10/n/r11/n/r12/n/r13/n/r14/n/r15/n/r16/n/r17/n/r18/n/r19/n/r20/n/r21/n/r22/n/r23/n/r24/n/r25/n/r26/n/r27/n/r28/n/r29/n/r30/n/r31/n/r32/n/r33/n/r34/n/r35/n/r36/n/r37/n/r38/n/r39/n/r40
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 /n/r0/n/r1/n/r2/n/r3/n/r4/n/r5/n/r6/n/r7/n/r8/n/r9/n/r10/n/r11/n/r12/n/r13/n/r14/n/r15/n/r16/n/r17/n/r18/n/r19/n/r20/n/r21/n/r22/n/r23/n/r24/n/r25/n/r26/n/r27/n/r28/n/r29/n/r30/n/r31/n/r32/n/r33/n/r34/n/r35/n/r36/n/r37/n/r38/n/r39/n/r40

preferences:
174.23 ms | 402 KiB | 203 Q