Re: Bug #16265 Updated: Multiply-defined functions in classes not reported

From: Date: Tue, 02 Apr 2002 09:58:14 +0000
Subject: Re: Bug #16265 Updated: Multiply-defined functions in classes not reported
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-82013@lists.php.net to get a copy of this message
Brad, How about post detailed benchmarks for your patch? IMHO. This bug is fatal. Especially those who are experienced with other OO languages, such as C++/Java. -- Yasuo Ohgaki Brad Lafountain wrote:
This bug is eaisly fixable. This is also something that i have been trying to push on a couple of threads now. You would need to do 3 things. 1) change the compiler so that inherited objects don't copy the opcodes of the functions. it will just store the parent's ce. 2) change the executor so it will execute functions recursivly thru the parents ce's ( i was talking about this change on engine2 list andi was arguing that it would be slower on execution of a function. I made the changes and it was faster. See the 'Mulitple Inhertiance' thread on engine2 list. This would also allow you to inherit overloaded objects defined in c.. ie Java) 3) again change the compiler to test only the current ce for re-definitions of the defined function. (derick already did this) So as far as im conserned making this change will solve many problems... But im really still confused why andi doesn't want this change. I will send my diff if you want. - Brad --- derick@php.net wrote:
ID:               16265
Updated by:       derick@php.net
Reported By:      dshadow@zort.net
-Status:           Open
+Status:           Suspended
Bug Type:         Scripting Engine problem
Operating System: Linux
PHP Version:      4.1.2
New Comment: I'm suspending this for now, this issue is not easily solved unfortunately. But we keep this on the todo list for future releases. Derick Previous Comments: ------------------------------------------------------------------------ [2002-04-01 21:37:21] yohgaki@php.net Need to open again. This bug may be suspended. ------------------------------------------------------------------------ [2002-03-25 15:32:48] derick@php.net Fixed in CVS, will also be in PHP 4.2.0 Derick ------------------------------------------------------------------------ [2002-03-25 13:12:42] dshadow@zort.net PHP does not report multiply-defined errors for class member functions. For example, the following script below, when executed, only outputs "two", with no errors. Instead, PHP should be giving error messages since the function bar has been defined multiple times. <? class foo {
       function bar() {echo "one\n";}
       function bar() {echo "two\n";}
} $f = new foo(); $f->bar(); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16265&edit=1
__________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://http://taxes.yahoo.com/


« previous php.dev (#82013) next »