Re: Re: new construct
| From: | Andrew Heebner | Date: | Tue, 25 Feb 2003 16:51:24 +0000 |
| Subject: | Re: Re: new construct | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-94564@lists.php.net to get a copy of this message | ||
Perhaps i may be mistaken, but it seems logical to search for the old-style
constructor first in order to be backwards compatible with old-style
scripts. Putting __construct in old style classes would yield a classname
of '__construct', an ugly and unlikely name for a class. Seeing as A::A()
would be much nicer, i can see the logic behind parsing the old-style first,
rather than the new-style.
That's just my two cents, feel free to correct me otherwise..
~ Andrew Heebner
>
> >__construct is the new method of defining a constructor, but
> >the 'bug' you suspect is not a bug. The parser will search
> >for a function of the same name in the class as the
> >constructor for backwards compatibility with Older scripts, etc...
>
> But shouldn't __construct() be searched for and used prior to the
> old-style constructor? Intuitively it seems it should.
>
> John
>