Re: [PATCH] [ZE] More useful error message for class redeclaration

From: Date: Mon, 23 Sep 2002 18:24:39 +0000
Subject: Re: [PATCH] [ZE] More useful error message for class redeclaration
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-88543@lists.php.net to get a copy of this message
If the zend_hash_add() fails then you can do a zend_hash_find() to retreive the class which is in the hash and print its information. If its information is NULL (we have to make sure we init it) then you can print out a message that it's an internal class. Does that make sense? Andi At 06:26 PM 9/23/2002 +0100, Wez Furlong wrote:
The problem is (as I understand it!) that the ZEND_DECLARE_CLASS case in do_bind_function_or_class retrieves the class entry for the user-defined class and not the internal class, and that is why the message reflects the user class. I can't really see why this is the case, but then I haven't really delved into how it all works :-/ --Wez. On 09/23/02, "Andi Gutmans" <andi@zend.com> wrote: Can't you make sure that the filename of internal classes will be NULL and then we can check for it and say it's an internal class? Andi At 03:59 PM 9/23/2002 +0100, Wez Furlong wrote:
Caveat Emptor: if someone tries to redeclare an internal/builtin class such as Directory, the previous declaration will appear to be the actual declaration in the script. I'm not sure of the best way to resolve this.


« previous php.dev (#88543) next »