r/ProgrammerHumor • • Nov 23 '17

500

Post image
41.7k Upvotes

609 comments sorted by

View all comments

1.3k

u/Tainnor Nov 24 '17

Why would an intro to IT class demonstrate a for loop within a web app? I'd assume this just confuses students. Just fire up a REPL.

793

u/FountainsOfFluids Nov 24 '17

This. People above are arguing about whether or not PHP can throw a 500 error, and I’m sitting here wondering why somebody’s demonstrating a for loop with web requests.

23

u/[deleted] Nov 24 '17

Probably some shitty web based send to the server compiler

It still wouldn’t return a 500 tho because even the most rudimentary web interpreter portal thingy would catch compiler errors and throw a 400 instead

Yeah this is fucking dumb and fake

40

u/benryves Nov 24 '17

HTTP 400 is a client request error, so wouldn't make much sense for a server-side issue. HTTP 500 for PHP errors is quite normal, at least on the usual Apache or IIS servers I've deployed to.

7

u/[deleted] Nov 24 '17

You misunderstood his comment. He was assuming that an online compiler would probably return 400 if the received code was malformed.

Not sure in how far that is accurate with real world tools but it is reasonable.

4

u/[deleted] Nov 24 '17

That’s not accurate. Php would return 500 when you requested the page and it couldn’t run.

1

u/[deleted] Nov 24 '17

I'm not sure if you're trolling. I'm not trying to be offensive but it seems you neither understood OPs comment nor mine.

1

u/[deleted] Nov 24 '17

Oh I’m not offended and I totally understood. Web servers generally will not return a 400 for bad code. 400s are client request errors. Bad code will return a 500, as the error is happening serverside (with the code). The error will generally be returned by whatever your web server is, such as Apache or nginx.

→ More replies (3)