Re: Valid class
| From: | Jean-Christian Imbeault | Date: | Fri, 18 Apr 2003 01:27:16 +0000 |
| Subject: | Re: Valid class | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144359@lists.php.net to get a copy of this message | ||
Sparky Kopetzky wrote:
Is you define an associative array that is empty and you initialize all of the elements of the array, would this be a good item to make into a class that can be called from anywhere??Anything is a "good idea", it depends on who's doing the judging.
I have a large number of attributes for a project and want to pass a single parameter (the associative array/class) to and fro without having a large number of parameters for each function. I would rather have the function extract what it need from the class/array.Your question is flawed. Technically I don't see any difference between passing an array to your function or a class. You're still passing just one variable and the function then extracts what it needs. My two cents, Jean-Christian Imbeault