Re: [PHP] Static utility class?
[email protected] (Stephen)
| Newsgroups | php.general |
|---|---|
| Message-ID | <[email protected]> |
On 13-09-04 05:09 PM, Micky Hulse wrote: > Thank you so much for the quick and very informative/educational > replies Stephen and David, I really appreciate it! :) > > On Wed, Sep 4, 2013 at 12:36 PM, Stephen <[email protected]> wrote: >> This sounds simply like a library of functions that are implemented using >> objects. >> Instantiate your static variables in the library file. Again, so that only >> happens once. > "functions implemented using objects" sounds like exactly what I want. > Just out of curiosity, and sorry in advance for my ignorance, but does > the code I posted fit that type of pattern? If not, what would I need > to modify and how would I call it? > > Actually, I should probably spend some time Googling before I ask you > for more details. :D Well, your code does not take advantage of the features of classes, but the syntax is correct. Global, static variables are not consistent with the design concepts of OOP. But as a first step in moving from procedural code to OOP, which is learning the syntax, go for it. -- Stephen