Am 12.03.2015 um 12:40 schrieb Niklas Keller: > > How would it behave for the second call? If the first initialize fails due > to some exception, should that static constructor be executed again? >
I think there a two different solutions and I do not know which one I prefer at the moment: 1. No second call can raise an fatal. 2. Yes should be executed again As an internal implementation, we can do a flag which is at creation time of class false and set after sucessful run of the static constructor to true. Do avoid deadlocks in loops like in the example maybe we can implement a combination of both solutions. We can implement the flag not as a boolean but as an integer counter. Raising a FATAL after X retries. Regards, -- DerOetzi -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php