3v4l.org

run code in 300+ PHP versions simultaneously
<?php class a { function b($i = 0) { if ($i > 25000) { die; } if ($i % 5000 == 0) { echo memory_get_usage() . "\n"; } $this->b(++$i); } } $a=new a; $a->b();
Output for 7.3.0 - 7.3.12
387488 1173952 2222528 3271104 4319680 5368256
Output for 7.2.0 - 7.2.24
383560 1170024 2218600 3267176 4315752 5364328
Output for 7.1.25 - 7.1.33
346888 1133352 2181928 3230504 4279080 5327656
Output for 7.1.0, 7.1.7
346960 1133424 2182000 3230576 4279152 5327728
Output for 7.1.5 - 7.1.6
347080 1133544 2182120 3230696 4279272 5327848
Output for 7.0.0 - 7.0.20
346960 1395568 2444144 3492720 4803440 5852016
Output for 5.6.0 - 5.6.28
220776 2687568 5154296 7752008 10218736 12816448
Output for 5.5.0 - 5.5.38
220768 2687552 5154280 7621008 10087736 12554464
Output for 5.4.10 - 5.4.45
221280 2557072 5023800 7359544 9826272 12162016
Output for 5.4.0 - 5.4.9
221280 2557064 5023792 7359536 9826264 12162008
Output for 5.3.11 - 5.3.29
623664 2958984 5818064 8677144 11536224 14395304
Output for 5.3.0 - 5.3.10
623360 2958656 5817736 8676816 11535896 14394976
Output for 5.2.10 - 5.2.17
81656 1873096 3665608
Process exited with code 139.
Output for 5.2.7 - 5.2.9
82456 1874960 3667432
Process exited with code 139.
Output for 5.2.6
82776 1875304 3667808
Process exited with code 139.
Output for 5.2.3 - 5.2.5
82776 1875304 3667792
Process exited with code 139.
Output for 5.2.2
80672 1873200 3665688
Process exited with code 139.
Output for 5.2.1
80672 1872096 3664584
Process exited with code 139.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/vCYnK on line 12
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_usage() in /in/vCYnK on line 12
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: memory_get_usage() in /in/vCYnK on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_usage() in /in/vCYnK on line 12

preferences:
176.27 ms | 401 KiB | 262 Q