<?php
echo "start\n";
register_shutdown_function(function() {
$err = error_get_last();
if ($err) {
echo "Yes error_get_last\n";
echo "Error is: ".print_r($err, True);
} else {
echo "No error_get_last\n";
}
echo "shutdown\n";
});
set_exception_handler(function($ex) {
if ($ex instanceof Error) {
echo "Exception Handler is Error\n";
return Null;
}
echo "Exception Handler\n";
die();
});
set_error_handler(function($errno, $errstr, $errfile, $errline, $errcontext) {
echo "Error Handler: ".$errstr."\n";
echo "Error Type: ".$errno."\n";
die();
#throw new ErrorException("raising errorexception", 0, $errno, $errfile, $errline);
});
class Foo {
public function __construct($ii) {
$this->internal = $ii;
}
public function foo1() {
if ($this->internal === 5) {
echo "Called Foo->foo1()\n";
}
}
}
$exists = new Foo(5);
#$exists->foo1();
#$exists->doesnotexist();
#doesnotexist();
#$doesnotexist->alsodoesnotexist();
#Foo::foo1();
$x = $y + 5;
#$file=fopen("welcome.txt","r");
#echo $foo . "appending<br />";
#$t = I_AM_NOT_DEFINED; #
#trigger_error("Triggered Error", E_USER_ERROR);
#password_hash("swordfish", PASSWORD_BCRYPT, array("salt"=>"sjienvidndiwnsosvknsfoiwnlnvsoi"));
echo "Continuing execution\n";
- Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
- start
Exception Handler is Error
No error_get_last
shutdown
- Output for 5.5.0 - 5.5.35, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
- start
Error Handler: Undefined variable: y
Error Type: 8
No error_get_last
shutdown
preferences:
183.6 ms | 403 KiB | 228 Q