Am 12.03.2015 um 00:30 schrieb Marco Pivetta:
> Hey Johannes,
> 
> Why can't this be done at autoloading time?

In my opinion this should not be done on autoloading time, but as a own
method inside the class for two reasons.

1. Not every class is loaded with autoload-functions, but although
directly with include_once or required_once functions

2. The initialization of needed things inside the class should be in the
domain of the class itself and not of someone outside. Thats why I
proposed to make it a private magic method not a public one. To do by
autoload or by calling it inside the included file after
class-definition like

class B {
    ...
} B::__static();

would require to make it public and means to give the responsibility to
do the necessary initialization to someone else.

> 
> Marco Pivetta
> 
> http://twitter.com/Ocramius
> 
> http://ocramius.github.com/
> 

Regards,
-- 
DerOetzi

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

Reply via email to