I am working on a class to handle forms and I have a dilema as to which way to store the from data within the object.
It strikes me that storing the GET/POST superglobals as a property of the object might just be doubling up on resources ( still I would like a central location where to refer to the data fields of the form).
My other option , I think, is to store the superglobals as reference eg.: $this->formDATA=($this->method=='GET') ? &$_GET : &$_POST;
What I would like to know is would doing this actually save any system memory? Is the new variable still a copy of the old that simply “checks back” or a “link” to the source?
Since the first thing your code should do is validate the entries passed in the super globals and to save the valid values into separate variables (where you can know throughout the subsequent processing that they must be valid) the super globals should not be getting anywhere near an object.