And here is the final version of my class redeclaration patch.
class Foo {}
class Foo {}
-> Fatal error: Cannot redeclare class foo
(previously declared in /home/wez/source/php/PHPDEV/wez.declare.class.php:3)
in /home/wez/source/php/PHPDEV/wez.declare.class.php on line 5
class Directory {}
-
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
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 rea
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:
>X-Managedo-partname: name="1.1"; mimetype="text/plain"
>Content-Type: text/plain; charset="iso-8859-1"
>Conte
I'm resubmitting this little patch for the ZE; when presented with
code like this:
The engine will generate an error message like this:
Cannot redeclare class Foo (previously declared in file.php:2)
Caveat Emptor: if someone tries to redeclare an internal/builtin class
such as Directory, the