Am 15.03.2015 um 11:02 schrieb Crypto Compress:
> 
>> I think I now get the misunderstanding I had on your destructor question
> 
> Sorry for confusion. My points are agnostic about implementation details
> and concrete code. It's up to ppl to use this feature as they like.
> 

Okay get your point, but as already discussed several times, the rfc
should not be declined for the reason a ppl, who doesn't understand when
to use static context or when not to use at all, can do crucial things.
Because he although can do without the static constructor.

For a horiffic example:

class Example {

     private static $handler;

     public function open() {
         self::$handler = fopen('example.txt');
     }

     ...

}

Example::open();

Indeed I have the opinion some beginner who is doing such horiffic code
maybe think more about what he is doing and especially about the side
effects inside a so called "magic" method, then outside.


> - first point is a logical conclusion: If there is a cctor, there should
> be a cdtor.

Okay the logical conclusion I can take in count. But doing 15 years of
OOP-programming now, I never had the need to have a cdtor, for a "valid"
usage of static context. And still after I have seen your examples,
which should all be done, as I explained, with instances instead of
direct static binding, I don't see the use case for a cdtor.

> - second point is about implicit order: Shutdown process will free in
> reversed creation order. Classes don't have guaranteed creation order.
> 

But I hope shutdown process of PHP is as intelligent not do unload a
class which is needed in another class before this class?!

Regards,
-- 
DerOetzi

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to