ID: 22253 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: win2k PHP Version: 4.2.3 New Comment:
It's by design and even documented here: http://www.php.net/manual/en/language.oop.constructor.php Previous Comments: ------------------------------------------------------------------------ [2003-02-21 17:37:00] andrew at evilwalrus dot com According to the comments on the OOP manual page, if a constructor is not located in the base class, the function of the same name will be located in subsequent classes, and loaded accordingly. Yes, this is by design, but no, i personally don't like it... correct me if i'm wrong, please. ~ Andrew Heebner ------------------------------------------------------------------------ [2003-02-17 11:38:10] [EMAIL PROTECTED] In this example, the printStr() method becomes the constructor of the printStr class, while I think it should not be working this way... I hope this is not by design ;) class String { function printStr($string) { print $string; } } class printStr extends String {} $ps = new printStr("abc"); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=22253&edit=1