ID: 46022
Updated by: [EMAIL PROTECTED]
Reported By: vivekanandan at classof1 dot com
-Status: Open
+Status: Bogus
-Bug Type: *General Issues
+Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 5.3.0alpha2
New Comment:
RTFM: "For backwards compatibility, if PHP 5 cannot find a
__construct() function for a given class, it will search for the old-
style constructor function, by the name of the class."
So in this case as you provide the "new" style (and proper)
constructor the BC fallback is simply ignored. No bug here.
Previous Comments:
------------------------------------------------------------------------
[2008-09-08 13:54:10] vivekanandan at classof1 dot com
Description:
------------
when we define both constructor types as class name as construct name
and __construct keyword , we need to produce error
Reproduce code:
---------------
class UserInfo{
function __construct(){
print "<br> __construct function is called ";
}
function UserInfo(){
print "UserInfo constructor is called";
}
function getUserInfo(){
print "<br>This is User Defined function ";
}
}
$obj = new UserInfo();
$obj->getUserInfo();
Expected result:
----------------
produce error : Constructor cannot be difined more than once
Actual result:
--------------
__construct function is called
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46022&edit=1