3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo memory_get_peak_usage()/(1024*1024) . 'MB', "\n"; $pass = str_repeat('a', 1024 * 1024 * 2); $pass . $pass; echo memory_get_peak_usage()/(1024*1024) . 'MB';
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
0.40249633789062MB 6.3766174316406MB
Output for 8.1.0 - 8.1.28
0.40278625488281MB 6.3769149780273MB
Output for 8.0.0 - 8.0.30
0.40263366699219MB 6.3764419555664MB
Output for 7.4.0 - 7.4.33
0.40280151367188MB 6.3767318725586MB
Output for 7.3.0 - 7.3.33
0.40256500244141MB 6.3766555786133MB
Output for 7.2.0 - 7.2.33
0.39821624755859MB 6.3728942871094MB
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33
0.36318206787109MB 6.3379516601562MB
Output for 5.6.0 - 5.6.38
0.21027374267578MB 6.2081451416016MB
Output for 5.5.0 - 5.5.38
0.21027374267578MB 6.208137512207MB
Output for 5.4.10 - 5.4.45
0.21021270751953MB 6.2085800170898MB
Output for 5.4.0 - 5.4.9
0.20970916748047MB 6.2080764770508MB
Output for 5.3.11 - 5.3.29
0.59738159179688MB 6.5925903320312MB
Output for 5.3.0 - 5.3.10
0.59709167480469MB 6.5923004150391MB
Output for 5.2.10 - 5.2.17
0.079414367675781MB 6.0747375488281MB
Output for 5.2.7 - 5.2.9
0.079444885253906MB 6.0747680664062MB
Output for 5.2.3 - 5.2.6
0.079750061035156MB 6.0750732421875MB
Output for 5.2.2
0.077766418457031MB 6.0731887817383MB
Output for 5.2.1
0.077766418457031MB 6.0732498168945MB
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_peak_usage() in /in/i3668 on line 2
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: memory_get_peak_usage() in /in/i3668 on line 2
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_peak_usage() in /in/i3668 on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: memory_get_peak_usage() in /in/i3668 on line 2

preferences:
274.41 ms | 401 KiB | 452 Q