- var_dump: documentation ( source)
- register_shutdown_function: documentation ( source)
- ini_set: documentation ( source)
<?php
ini_set('memory_limit', 2048);
register_shutdown_function(function () {
$y = [];
for ($i = 0; $i < 1000; $i++) {
$y[] = $i;
}
var_dump([ 'total count is' => count($y) ]);
});
$x = [];
for ($i = 0; $i < 1000000000; $i++) {
$x[] = $i;
}