3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('memory_limit', '512M'); echo "Memory limit: ", ini_get('memory_limit'), "\n\n"; $finfo = new finfo(FILEINFO_MIME_TYPE); $minSize = 128 * 1024; $maxSize = 16 * 1024 * 1024; for($size = $minSize; $size <= $maxSize; $size *= 2) { $content = str_repeat('0', $size); echo "Content size: ", number_format(strlen($content)/1024/1024, 1), "M\n"; $finfo->buffer($content); echo "Peak memory usage: ", number_format(memory_get_peak_usage(true)/1024/1024, 1), "M\n\n"; }

Abusive script

This script was stopped while abusing our resources

Output for 7.3.0 - 7.3.19, 7.4.0 - 7.4.7
Memory limit: 512M Content size: 0.1M Peak memory usage: 4.0M Content size: 0.3M Peak memory usage: 6.0M Content size: 0.5M Peak memory usage: 11.0M Content size: 1.0M Peak memory usage: 18.0M Content size: 2.0M Peak memory usage: 34.0M Content size: 4.0M Peak memory usage: 64.0M Content size: 8.0M Peak memory usage: 124.0M Content size: 16.0M Peak memory usage: 244.0M
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.31
Memory limit: 512M Content size: 0.1M Peak memory usage: 2.0M Content size: 0.3M Peak memory usage: 4.0M Content size: 0.5M Peak memory usage: 7.0M Content size: 1.0M Peak memory usage: 10.0M Content size: 2.0M Peak memory usage: 18.0M Content size: 4.0M Peak memory usage: 32.0M Content size: 8.0M Peak memory usage: 60.0M Content size: 16.0M Warning: finfo::buffer(): Failed identify data 12:cannot allocate 134217736 bytes (Cannot allocate memory) in /in/LNNoV on line 13 Peak memory usage: 60.0M
Output for 5.6.0 - 5.6.40
Memory limit: 512M Content size: 0.1M Peak memory usage: 1.8M Content size: 0.3M Peak memory usage: 3.0M Content size: 0.5M Peak memory usage: 4.8M Content size: 1.0M Peak memory usage: 8.3M Content size: 2.0M Peak memory usage: 15.3M Content size: 4.0M Peak memory usage: 29.3M Content size: 8.0M Peak memory usage: 57.3M Content size: 16.0M Warning: finfo::buffer(): Failed identify data 12:cannot allocate 134217736 bytes (Cannot allocate memory) in /in/LNNoV on line 13 Peak memory usage: 57.3M
Output for 5.4.32 - 5.4.45, 5.5.16 - 5.5.38
Memory limit: 512M Content size: 0.1M Peak memory usage: 1.8M Content size: 0.3M Peak memory usage: 3.0M Content size: 0.5M Peak memory usage: 4.8M Content size: 1.0M Peak memory usage: 8.3M Content size: 2.0M Peak memory usage: 15.3M Content size: 4.0M Peak memory usage: 29.3M Content size: 8.0M Peak memory usage: 57.3M Content size: 16.0M
Process exited with code 139.
Output for 5.4.30, 5.5.15
Memory limit: 512M Content size: 0.1M Peak memory usage: 1.8M Content size: 0.3M Peak memory usage: 3.0M Content size: 0.5M Peak memory usage: 5.0M Content size: 1.0M Peak memory usage: 9.0M Content size: 2.0M Peak memory usage: 17.0M Content size: 4.0M Peak memory usage: 33.0M Content size: 8.0M
Process exited with code 137.
Output for 5.4.28, 5.4.31, 5.5.12 - 5.5.14
Memory limit: 512M Content size: 0.1M Peak memory usage: 1.8M Content size: 0.3M Peak memory usage: 3.0M Content size: 0.5M Peak memory usage: 5.0M Content size: 1.0M Peak memory usage: 9.0M Content size: 2.0M Peak memory usage: 17.0M Content size: 4.0M Peak memory usage: 33.0M Content size: 8.0M Peak memory usage: 65.0M Content size: 16.0M
Process exited with code 137.
Output for 5.4.29
Memory limit: 512M Content size: 0.1M Peak memory usage: 1.8M Content size: 0.3M Peak memory usage: 3.0M Content size: 0.5M Peak memory usage: 5.0M Content size: 1.0M Peak memory usage: 9.0M Content size: 2.0M Peak memory usage: 17.0M Content size: 4.0M Peak memory usage: 33.0M Content size: 8.0M Peak memory usage: 65.0M Content size: 16.0M
Process exited with code 139.
Output for 5.3.29
Memory limit: 512M Content size: 0.1M Peak memory usage: 2.0M Content size: 0.3M Peak memory usage: 3.5M Content size: 0.5M Peak memory usage: 5.5M Content size: 1.0M Peak memory usage: 9.5M Content size: 2.0M Peak memory usage: 17.5M Content size: 4.0M Peak memory usage: 33.5M Content size: 8.0M
Process exited with code 137.

preferences:
98.2 ms | 466 KiB | 5 Q