3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(ini_get('memory_limit')); ini_set('memory_limit', '16K'); var_dump(ini_get('memory_limit')); str_repeat('a', 2**31);
Output for 8.1.0 - 8.1.29, 8.2.0 - 8.2.20, 8.3.0 - 8.3.8
string(3) "64M" Warning: Failed to set memory limit to 16384 bytes (Current memory usage is 2097152 bytes) in /in/n9sr7 on line 4 string(3) "64M" Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 2147483680 bytes) in /in/n9sr7 on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.12, 8.0.14 - 8.0.30
string(3) "64M" string(3) "16K" Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 2147483680 bytes) in /in/n9sr7 on line 6
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 8.0.13
string(4) "128M" string(3) "16K" Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 2147483680 bytes) in /in/n9sr7 on line 6
Process exited with code 255.
Output for 5.6.9 - 5.6.40
string(3) "64M" string(3) "16K" Warning: str_repeat(): Result is too big, maximum 2147483647 allowed in /in/n9sr7 on line 6
Output for 5.6.0 - 5.6.8
string(3) "64M" string(3) "16K" Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 2147483649 bytes) in /in/n9sr7 on line 6
Process exited with code 255.
Output for 5.5.0 - 5.5.38
Parse error: syntax error, unexpected '*' in /in/n9sr7 on line 6
Process exited with code 255.

preferences:
264.71 ms | 402 KiB | 335 Q