|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-09-08 18:56 UTC] jani@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 20:00:01 2025 UTC |
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