- error_reporting: documentation ( source)
- printf: documentation ( source)
<?php
error_reporting(E_ALL|E_STRICT);
function do_test(): int {
try {
1/0; // a warning in php 7 - reported as documented
nonexistent_function(); // a fatal error - not reported - program continues
1%0; // a fatal error
return 0;
} catch (Throwable $t) {
printf("CATCH\n");
return 1;
} finally {
printf("FINALLY\n");
return 2;
}
return 3;
}
printf("%d\n", do_test());