Re: New zend_compile.c to solve all of the duplicate function problems

From: Date: Thu, 18 Oct 2001 17:05:08 +0000
Subject: Re: New zend_compile.c to solve all of the duplicate function problems
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-68260@lists.php.net to get a copy of this message
----- Original Message ----- From: "Stanislav Malyshev" <stas@zend.com> To: "Brian Moon" <brianm@dealnews.com> Cc: "PHP Development" <php-dev@lists.php.net> Sent: Thursday, October 18, 2001 10:53 AM Subject: Re: [PHP-DEV] New zend_compile.c to solve all of the duplicate function problems > BM>> And my fix will keep a function from being defined twice. It > BM>> will simply also allow people who have become accustomed to > BM>> using the language this way to keep doing it. > > I'm not sure that being allowed to use a language in a buggy way is a > right thing to do... This would hide many "double include" errors, and > would *not* restore the backwards compatibility - since code that didn't > work then would work now with your patch. > I don't think that's true. From what I can tell, if a different function in a different location in the same file or another file is encountered by the compiler, his patch with produce a fatal error. This fixes the problem where people were attempting to actually redefine a function name. Brian's patch allows the compiler to encounter the same function in the same file on the same line and only give a notice instead of a fatal error. It's not the most elegant solution, but then again, we have no #ifdef and #ifndef as you C coders do to allow us to properly create function libraries. If/else could be used to achieve similar results, but from what I understand, only under a serious performance penalty. Which, BTW, is very unacceptable. Daniel

« previous php.dev (#68260) next »