3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = []; print memory_get_usage() . PHP_EOL; $array['key1'] = 'val1'; print memory_get_usage() . PHP_EOL; $array['key2'] = 'val2'; print memory_get_usage() . PHP_EOL; $array['key3'] = 'val3'; print memory_get_usage() . PHP_EOL;
based on kagqW
Output for 7.1.0
347064 347472 347472 347472
Output for 7.0.0 - 7.0.14
347120 347472 347472 347472
Output for hhvm-3.10.0 - 3.12.0
2097152 2097152 2097152 2097152
Output for 5.6.8 - 5.6.28
217864 218136 218272 218408
Output for 5.5.24 - 5.5.35
217864 218120 218256 218392
Output for 5.4.10 - 5.4.45
218384 218640 218776 218912
Output for 5.4.0 - 5.4.9
217856 218112 218248 218384
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/SSZtM on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/SSZtM on line 2
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/SSZtM on line 2
Process exited with code 255.