#38064 [Asn->Csd]: ignored constructor visibility
| From: | helly@php.net | Date: | Mon, 07 Aug 2006 23:25:23 +0000 |
| Subject: | #38064 [Asn->Csd]: ignored constructor visibility | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-100482@lists.php.net to get a copy of this message | ||
ID: 38064
Updated by: helly@php.net
Reported By: instance at o2 dot pl
-Status: Assigned
+Status: Closed
Bug Type: Class/Object related
Operating System: *
PHP Version: 5.1.*
Assigned To: helly
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-07-17 19:43:29] mike@php.net
It shouldn't even be possible to override a private/protected ctor with
a public one.
Can you please take a look at it Marcus?
------------------------------------------------------------------------
[2006-07-11 11:56:51] instance at o2 dot pl
Description:
------------
Private __construct() can be called form inherited class constructor
via parent::__construct();
I'm not sure, this was not reported, but I didn't found any this kind.
Also in PHP version 5.2 this was occured (not by me).
Thx.
Reproduce code:
---------------
<?php
class A{
private function __construct(){}
}
class B extends A{
public function __construct(){
parent::__construct();
}
}
$instance=new B();
?>
Expected result:
----------------
Fatal error: Call to private method A::__construct() from context 'B'
Actual result:
--------------
no error - everything is fine
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38064&edit=1