Skip to content

@cthos /ini_bug.php
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Php ini dusplay_errors bug?
<?php
error_reporting(E_ALL);
var_dump(ini_get('display_errors'));
var_dump(ini_get('error_reporting'));
//set_error_handler('custHandler');
register_shutdown_function('shutdownHandler');
echo $meow['llama'];
function custHandler($errno, $errstr, $errfile, $errline, $errcontext)
{
echo "Custom handler called.";
}
function shutdownHandler()
{
echo "I died.";
var_dump(error_get_last());
}
$data = '';
while(true) {
$data .= str_repeat('#', PHP_INT_MAX);
}
@cthos
Owner

Output:

string(0) ""
string(5) "30719"
PHP Notice: Undefined variable: meow in /home/alex/Documents/Code/test/fatal.php on line 17
PHP Fatal error: Out of memory (allocated 786432) (tried to allocate 9223372036854775808 bytes) in /home/alex/Documents/Code/test/fatal.php on line 32
I died.array(4) {
["type"]=>
int(1)
["message"]=>
string(78) "Out of memory (allocated 786432) (tried to allocate 9223372036854775808 bytes)"
["file"]=>
string(40) "/home/alex/Documents/Code/test/fatal.php"
["line"]=>
int(32)
}

@cthos
Owner

Expected Output:
I died.array(4) {
["type"]=>
int(1)
["message"]=>
string(78) "Out of memory (allocated 786432) (tried to allocate 9223372036854775808 bytes)"
["file"]=>
string(40) "/home/alex/Documents/Code/test/fatal.php"
["line"]=>
int(32)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.