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) { $file = tempnam('/tmp', 'finfo'); file_put_contents($file, str_repeat('0', $size)); echo "Content size: ", number_format(filesize($file)/1024/1024, 1), "M\n"; $finfo->file($file); echo "Peak memory usage: ", number_format(memory_get_peak_usage(true)/1024/1024, 1), "M\n\n"; }
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.30, 7.4.0 - 7.4.23, 8.0.0 - 8.0.11, 8.1rc1 - rc2
Memory limit: 512M
Process exited with code 153.
Output for 5.2.1 - 5.2.17
Memory limit: 512M Fatal error: Class 'finfo' not found in /in/M3YLG on line 6
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0
Memory limit: Fatal error: Class 'finfo' not found in /in/M3YLG on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Memory limit: Fatal error: Cannot instantiate non-existent class: finfo in /in/M3YLG on line 6
Process exited with code 255.
Output for 4.3.1
Memory limit: Fatal error: Cannot instantiate non-existent class: finfo in /in/M3YLG on line 6

preferences:
32.7 ms | 462 KiB | 5 Q