3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = range(1, 100000); var_dump(memory_get_peak_usage()); foreach (array_chunk($a, 10) as $element) { } var_dump(memory_get_peak_usage());
Output for 8.5.0 - 8.5.1
int(2562304) int(6588632)
Output for 8.4.1 - 8.4.14, 8.4.16
int(2488288) int(6514616)
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.2.0 - 8.2.30, 8.3.0 - 8.3.27, 8.3.29
int(2488304) int(6514632)
Output for 8.3.28
/bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28)
Process exited with code 1.
Output for 8.1.0 - 8.1.34
int(4585768) int(12074240)
Output for 8.0.0 - 8.0.30
int(4585304) int(12073776)
Output for 7.4.0 - 7.4.33
int(4585608) int(12074080)
Output for 7.3.0 - 7.3.33
int(4585528) int(12074000)
Output for 7.2.0 - 7.2.33
int(4581552) int(12070024)

preferences:
182.04 ms | 416 KiB | 5 Q