#44149 [Fbk->Opn]: something wrong in overload

From: Date: Tue, 19 Feb 2008 05:33:46 +0000
Subject: #44149 [Fbk->Opn]: something wrong in overload
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-122445@lists.php.net to get a copy of this message
ID: 44149 User updated by: edwardpro dot zhu at gmail dot com Reported By: edwardpro dot zhu at gmail dot com -Status: Feedback +Status: Open Bug Type: Class/Object related Operating System: RHEL 5 PHP Version: 5.2.5 New Comment: i just try php 5.2.6 the result, i get, is the same as the 5.2.5. look my instance order: new child('a'); it's not "function child()", but php run this construction function,that's may accour something unexcepted result. Previous Comments: ------------------------------------------------------------------------ [2008-02-18 16:12:38] felipe@php.net Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.2-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.2-win32-installer-latest.msi It works fine to me on 5.2.6. ------------------------------------------------------------------------ [2008-02-18 12:22:41] edwardpro dot zhu at gmail dot com Description: ------------ when extends father class,which declared one contruction function with params, then you extend this class and declare one another contruction function in it(not same the params list as his father class). Run it, you will find something unexcepted output. You can check the code belowed. Reproduce code: --------------- abstract class father{ function father($a){ echo "class father"; } } class child extends father{ function child(){ echo "test"; } } //run $obj = new child('a'); Expected result: ---------------- no error,no output. Actual result: -------------- return wrong message: can't redeclare contraction function! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44149&edit=1

« previous php.bugs (#122445) next »