3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { function b($i = 0) { if ($i > 45000) { die; } if ($i % 5000 == 0) { echo memory_get_usage() . "\n"; } static::b(++$i); } } $a=new a; $a->b();
Output for 7.2.0
383600 1170064 2218640 3267216 4315792 5364368 6412944 7461520 8510096 9558672
Output for 7.1.0, 7.1.7
346960 1133424 2182000 3230576 4279152 5327728 6376304 7424880 8473456 9522032
Output for 7.1.5 - 7.1.6
347080 1133544 2182120 3230696 4279272 5327848 6376424 7425000 8473576 9522152
Output for 7.0.0 - 7.0.20
347088 1395696 2706416 3754992 5065712 6114288 7425008 8735728 9784304 11095024
Output for 5.6.0 - 5.6.28
220784 2687584 5154312 7752024 10218752 12816464 15283192 17749920 20347632 22814360
Output for 5.5.0 - 5.5.38
220776 2687544 5154272 7621000 10087728 12554456 15021184 17487912 19954640 22552352
Output for 5.4.0 - 5.4.45
221288 2557088 5023816 7359560 9826288 12162032 14628760 16964504 19431232 21766976
Output for 5.3.11 - 5.3.29
623784 2959072 5818152 8677232 11536312 14395392 16730656 19589736 22448816 25307896
Output for 5.3.0 - 5.3.10
623480 2958752 5817832 8676912 11535992 14395072 16730336 19589416 22448496 25307576
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_VARIABLE in /in/ZTPte on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_VARIABLE in /in/ZTPte on line 15
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' in /in/ZTPte on line 15
Process exited with code 255.

preferences:
170.1 ms | 401 KiB | 216 Q