Re: Re: static call bugs?
| From: | Andi Gutmans | Date: | Sat, 10 Mar 2001 00:58:36 +0000 |
| Subject: | Re: Re: static call bugs? | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-48485@lists.php.net to get a copy of this message | ||
At 01:48 AM 3/10/2001 +0100, André Langhorst wrote:
It does: a) Calls an ancestor's method which can rely on $this b) Another classes method (unrelated) which shouldn't rely on $thisI still don't understand what the problem is? What should be documented is the right way to use these calls.problem 1 : how do I call the "::" operator and how do I call what it does if it is no static call.
problem 2 : the "bug" with incorrect $this I mentioned, it is at least unexcpected and should be documented (that you can't rely on $this using "::" ) but since no one likes undefined behaviour it would be fine to see it fixed - my opinion is that using "::" $this should never be set to anything...Every language implementation including C/C++ has undefined/unexpected behavior when you use constructs in ways they aren't meant/documented for. There is nothing to fix here like there's nothing to fix in gcc. It happens that $this is meant to propogate with a :: call because it is meant to work in case 1) above.
:: should be documented in the way I mentioned above.PEAR relies on the $this being correct even when you call a method which is not in the current class or in one of its parent classes?no, it simply uses "::" that is an undocumented feature
I'll try and read through this tomorrow. AndiWhere can I see the documentation? (Any chance you can send it here to save me the time? :). We just need to be sure we don't document things which aren't necessarily supposed to work.http://toye.php.net/~andre/html/keyword.newref.html