- str_repeat: documentation ( source)
- memory_get_usage: documentation ( source)
- register_shutdown_function: documentation ( source)
- ini_set: documentation ( source)
- set_error_handler: documentation ( source)
<?php
ini_set('memory_limit', '2K');
//$y = str_repeat("x", 1000);
set_error_handler(function() {
//global $y;
//$y = '';
print 'Ahh, there is a fatal';
//print memory_get_usage();
});
register_shutdown_function(function() {
print memory_get_usage();
print 'Shutdown';
});
//print memory_get_usage();
$x = str_repeat("x", 2*1024*1024);