Skip to content

Instantly share code, notes, and snippets.

@synsh
Created August 7, 2017 18:33
Show Gist options
  • Save synsh/f3b7cc8cb9ff243de39742633fa843f1 to your computer and use it in GitHub Desktop.
Save synsh/f3b7cc8cb9ff243de39742633fa843f1 to your computer and use it in GitHub Desktop.
<?php
$app->get('/exception', function ($req, $res, $args) {
// errorHandler will trap this Exception
throw new Exception("An error happened here");
});
$app->get('/php7', function ($req, $res, $args) {
$x = function (int $x) {
return $x;
};
// phpErrorHandler wil trap this Error
$x('test');
});
$app->get('/warning', function ($req, $res, $args) {
$x = UNDEFINED_CONSTANT;
echo "string";
});
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment