Re: Suggestion - Php Enhancement
| From: | Kalle Sommer Nielsen | Date: | Sat, 14 Aug 2010 15:36:54 +0000 |
| Subject: | Re: Suggestion - Php Enhancement | ||
| References: | 1 | Groups: | php.webmaster |
| Request: | Send a blank email to php-webmaster+get-8738@lists.php.net to get a copy of this message | ||
Greetings
2010/8/14 Hermann von Bargen <hermann@itod.co.za>:
> 2) As version 5.3.3. now has the 'named' constructor available
Thats a PHP4 legacy and I guess should be removed, PHP 5.3.3 removed
support for that in namespaced classes.
> please also
>
> function ~Bar(){ ... } to compliment
>
> function __desctructor(){ .. }
>
> }
>
That is not possible as the ~ is a bitwise operator in the scanner,
meaning if we re-use it, it will create all kind of different issues
and render the scanner more complex than any of us want it. Simply use
the __construct/__destruct methods instead of adding yet another
gateway for a legacy feature.
> With version 5.3.2 I have found that calling the __constructor($parameters)
> does not always seem to work, but Bar($parameters) would work. Hopefully
> just a quirk, not a bug.
The constructor is named "__construct", same as the destructor i wrote
about above. __construct also have a higher priority over "class named
constructors":
C:\php\trunk>php -r "class A { public function A(){ echo __METHOD__,
PHP_EOL; } public function __construct(){ echo __METHOD__, PHP_EOL; }
} new A;"
A::__construct
Also this is the webmaster list, and is for the development of the
PHP.net websites. I guess what you are looking for is the general PHP
list, see:
http://www.php.net/mailinglists
--
regards,
Kalle Sommer Nielsen
kalle@php.net