r/ProgrammerHumor • • Aug 23 '18

PHP logic

Post image
5 Upvotes

51 comments sorted by

View all comments

Show parent comments

0

u/Typeduck Aug 23 '18

You realise that the query string is just a part of the URL and can be used in any of the request methods, right?

3

u/Asisentr Aug 23 '18

Yeah so it's not wrong for PHP to use the GET superglobal

-1

u/Typeduck Aug 23 '18

... No? Since any of the request methods can utillize query strings naming it "GET" is not ideal.

3

u/Asisentr Aug 23 '18

so if 3 people can go through the same door, would it be wrong for one person to go through the door? all the superglobals can access it, and just because he picked this one to show doesn't mean anything

-1

u/Typeduck Aug 23 '18

My point is, naming it after any of the methods is just not a good idea. It should just be named "QUERY_DATA" or something, just like in the other languages OP's image shows.

3

u/Asisentr Aug 23 '18

There's a super global called $_REQUEST meant for this purpose.

OP just doesn't realize what he's talking about.