Re: Static constructor support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 26.09.2012 23:20 CE(S)T, Stuart Dallas wrote:
> If you mean what C# calls a static constructor, no that does not
> exist in PHP, but you can fake it.

Okay, thank you for the quick info.

How do other languages than C# call that? :-)

My class is a debug helper class, that can write trace messages and so
on. I have added a random per-request tag to distinguish concurrent
requests in the trace file and thought that generating such a tag would
perfectly fit in a static constructor. Now a helper function does that
check and generates one on the first call of the method.

-- 
Yves Goergen - nospam.list@xxxxxxxxxxxxxxx - http://unclassified.de

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux