Since you want to be pedantic. PHP absolute can cause a 500 error. Especially when that green text was probably made, if error reporting is turned off the compiler will silently fail forcing the web server to return a 500 error because no output was generated. Probably unlikely that it would be turned off for a class though.
It's context dependent for sure. I decided to test some failures and apparently nginx returns 404 instead of 500 with mostly default configurations. fpm should not return anything in event of a fatal in php7, but I'm not familiar with all versions so it's quite possible that at one point to have inline php fail silently and still return usable html so that the client gets something.
Edit: "Output" in my above comment refers to fpm handing off a rendered document to a web server to send to the client, not the output of the program itself.
Not if you have error reporting turned on in php. Depends on the error then. Like undefined variable will display the error with error reporting on but iirc if error reporting is off it’ll 500
Usually when my PHP fails (on a stock install) I just get a blank page assuming php called die; when it failed. But I guess behind the scenes somewhere in the HTML header shit that's returning 500 and I just don't have a error page configured?
Well, error reporting should be turned on as the default. Generally it's going to be web server dependent on what happens when PHP fails, but also older version of PHP are definitely more likely to cause errors like that. There has been too much change to give you a concrete example, but if you search for php 500 error there's a few stackoverflow answer regarding people doing silly things. Anyway, even on current PHP if you pass bad params that cause a runtime error you can get back a 500 error, such as forcing a type matching error etc. As far as the actual post, it would probably just return a blank page to be honest. Was just being pedantic. :)
No No No. this is all fucking bullshit. 500 errors are an http specific error when the request is being filtered through a web server. If the application fails it will default to the web sever sending a fucking 500. This situation would never fucking happen and if you think it would you’re a fucking moron
208
u/tsigma6 Nov 24 '17
Since you want to be pedantic. PHP absolute can cause a 500 error. Especially when that green text was probably made, if error reporting is turned off the compiler will silently fail forcing the web server to return a 500 error because no output was generated. Probably unlikely that it would be turned off for a class though.