On 24.02.2010, at 15:11, Alain Williams wrote: > On Wed, Feb 24, 2010 at 02:20:38PM +0300, Alexey Zakhlestin wrote: >> >> On 24.02.2010, at 13:28, Alain Williams wrote: > >>> Objects are not always the answer. >> >> in situation, which you described, objects are definitely the answer. >> you have several functions, which share the same "state". that's very close >> to the definition of object. > > Maybe 'private static' -- ie shared between different objects. > It is not always appropriate, eg a generic logging function, called from all > over > the place - it is not always convenient to pass a logging object around; > you just want to call the logging function.
this one is solved by singleton ;) gives real protection for "private" var as a bonus -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php