3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function myTest() { static $x = 0; echo $x; $x++; } For ($i=0;$i<=40;$i++){ print '/n/r'; myTest(); } ?>
based on M3tC1
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
/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