3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo memory_get_peak_usage() . "\n"; $var = ['hallo']; var_dump($var); echo memory_get_peak_usage() . "\n"; $var['test'] = 'hallo'; var_dump($var); echo memory_get_peak_usage() . "\n";
Output for 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
423056 array(1) { [0]=> string(5) "hallo" } 423056 array(2) { [0]=> string(5) "hallo" ["test"]=> string(5) "hallo" } 423056
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 423056 array(1) { [0]=> string(5) "hallo" } 423056 array(2) { [0]=> string(5) "hallo" ["test"]=> string(5) "hallo" } 423056
Output for 8.1.0 - 8.1.28
423520 array(1) { [0]=> string(5) "hallo" } 423520 array(2) { [0]=> string(5) "hallo" ["test"]=> string(5) "hallo" } 423520
Output for 8.0.0 - 8.0.30
423360 array(1) { [0]=> string(5) "hallo" } 423360 array(2) { [0]=> string(5) "hallo" ["test"]=> string(5) "hallo" } 423360
Output for 7.4.0 - 7.4.33
423536 array(1) { [0]=> string(5) "hallo" } 423536 array(2) { [0]=> string(5) "hallo" ["test"]=> string(5) "hallo" } 423536
Output for 7.3.0 - 7.3.33
423256 array(1) { [0]=> string(5) "hallo" } 423256 array(2) { [0]=> string(5) "hallo" ["test"]=> string(5) "hallo" } 423256
Output for 7.2.0 - 7.2.33
418632 array(1) { [0]=> string(5) "hallo" } 418632 array(2) { [0]=> string(5) "hallo" ["test"]=> string(5) "hallo" } 418632
Output for 7.1.25
381896 array(1) { [0]=> string(5) "hallo" } 381896 array(2) { [0]=> string(5) "hallo" ["test"]=> string(5) "hallo" } 381896
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20
381968 array(1) { [0]=> string(5) "hallo" } 381968 array(2) { [0]=> string(5) "hallo" ["test"]=> string(5) "hallo" } 381968

preferences:
134.8 ms | 402 KiB | 187 Q