Re: [PHP] Static vs. Instantiated Objects in PHP

2006-04-20 Thread Jochem Maas
statically calling a method is faster than init'ing an object then calling a method. static methods (as opposed to functions in the global space) automatically give a sort of namespacing, and a way to organise code (although that rather cosmetic). methods that are defined as static do not define

Re: [PHP] Static vs. Instantiated Objects in PHP

2006-04-20 Thread Mark Baldwin
It was helpful. I agree about programming to what is defined and declared in a language, but experience has taught that some methods are better than others (i.e. joining an array vs string concatenation in javascript). So I mostly just wanted to convince myself that static was sane in 5, an

Re: [PHP] Static vs. Instantiated Objects in PHP

2006-04-20 Thread Anas Mughal
I would not worry about internal implementation of PHP5. (Who knows, they may change things around a little bit in PHP6!) In general, program to what is defined and declared in a language. That is our contract with the Zend engine. Remember, static method calls are resolved at compile time. Moreo

Re: [PHP] Static vs. Instantiated Objects in PHP

2006-04-20 Thread Richard Lynch
On Thu, April 20, 2006 7:15 pm, Mark Baldwin wrote: > What?!? Why the need to make faces? Seems like a legitimate question > to ask what goes on behind the scenes when you program a certain way. Because your analysis (deleted for brevity) is rather shallow. Perhaps static objects create an instan

Re: [PHP] Static vs. Instantiated Objects in PHP

2006-04-20 Thread Mark Baldwin
What?!? Why the need to make faces? Seems like a legitimate question to ask what goes on behind the scenes when you program a certain way. Here's the rub, if static objects are treated the way they probably should be (as a function pointer), then why bother using object oriented syntax? You

Re: [PHP] Static vs. Instantiated Objects in PHP

2006-04-20 Thread Richard Lynch
On Thu, April 20, 2006 1:25 pm, Mark Baldwin wrote: > Does anyone know how static objects work behind the scenes in PHP5? > More specifically, is there a benefit to declaring an object and its > methods as static vs the more traditional OO way of instantiating an > object and then calling methods t