diff --git a/examples/error/const-ref.php b/examples/error/const-ref.php new file mode 100644 index 00000000..a41ccfe6 --- /dev/null +++ b/examples/error/const-ref.php @@ -0,0 +1,5 @@ +on('request', function ($request, $response) { + try { + $response->header('Content-Type', 'text/plain'); + $response->end('Hello World'); + } catch (Exception $e) { + $response->status(500); + $response->end('error: ' . $e->getMessage()); + } + }); + + $http->start(); +} \ No newline at end of file