I want to be able to "make" browser display errors, like forbidden, 503 etc...
Is there some kind of sandbox where I could do this?
I need the errors to be rendered in google chrome, then take a screen capture of browser window.
Something like image under it, but force the browser to display something like this, maybe in Chrome dev tools could be done?

You can do this with try-catch condition and set_exception_handler function like this:
For more information you may visit site https://netgen.io/blog/modern-error-handling-in-php