3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = str_repeat('a', 1 * 1024 * 1024); echo 'Memory usage start: ' . memory_get_usage() . PHP_EOL; echo '$x is: ' . gettype($x) . PHP_EOL; do_unset( $x ); echo 'Memory usage after do_unset: ' . memory_get_usage() . PHP_EOL; echo '$x is: ' . gettype($x) . PHP_EOL; do_null( $x ); echo 'Memory usage after do_null: ' . memory_get_usage() . PHP_EOL; echo '$x is: ' . gettype($x) . PHP_EOL; function do_unset( & $x ) { unset($x); } function do_null( & $x ) { $x = null; }

preferences:
33.08 ms | 402 KiB | 5 Q