3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(ini_get('memory_limit')); ini_set('memory_limit', '16K'); var_dump(ini_get('memory_limit')); str_repeat('a', 2 << 31);
based on n9sr7
Output for 7.0.0 - 7.2.0
string(3) "64M" string(3) "16K" Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 4294967328 bytes) in /in/KPO3M on line 6
Process exited with code 255.
Output for 5.4.41 - 5.4.45, 5.5.25 - 5.5.35, 5.6.9 - 5.6.28
string(3) "64M" string(3) "16K" Warning: str_repeat(): Result is too big, maximum 2147483647 allowed in /in/KPO3M on line 6
Output for 5.3.21 - 5.4.40, 5.5.24, 5.6.8
string(3) "64M" string(3) "16K" Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 4294967297 bytes) in /in/KPO3M on line 6
Process exited with code 255.