- var_export: documentation ( source)
- set_error_handler: documentation ( source)
<?php
function handler($errno, $errstr, $errfile, $errline){
echo "Handler in action: \n";
var_export($errstr);
return true;
}
set_error_handler("handler");
$input = "Fly again";
function test(string $test) : string {
return $test;
}
try{
echo test($input);
} catch(Exception $ex) {
echo "Catched Exception: \n";
var_export($ex);
} catch(Error $er) {
echo "Catched Error: \n";
var_export($er);
}