class - Should I be passing S_ variables into functions - PHP -


i building little website project on side , having go @ mvc.

i have built request class, , router class.

simple enough question, have read on place globals bad such whatever reason, should passing in, $_get, $_post, $_server etc request class, or referencing them inside request class.

new request($_get, $_post, $_server); 

or

new request(); 

thanks.

one of main aspects of oop abstraction. class should not know global variables. if change key of get. first method common way.


Comments

Popular posts from this blog

c++ - protocol buffers - generate NON-inline accessors -

c# - issue attaching/adding an entity object which is detached from the DB Context? -