- var_dump: documentation ( source)
- var_export: documentation ( source)
<?php
function test(): int {
try {
return 5;
} finally {
try {
// NOOP
} catch(Exception $e) {
// NOOP
var_export($e);
die("catch");
} catch(TypeError $e) {
var_dump($e);
die("typeerror");
}
finally {
// NOOP
die("finally");
}
}
}
$a = test();
if($a !== 5) {
echo "FAILED: expected 5, recieved ", var_export($a), PHP_EOL;
} else {
echo "Passed", PHP_EOL;
}