#46693 [Opn->Fbk]: inherit Parent's private, not report error

From: Date: Fri, 28 Nov 2008 12:34:42 +0000
Subject: #46693 [Opn->Fbk]: inherit Parent's private, not report error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-131440@lists.php.net to get a copy of this message
ID: 46693 Updated by: jani@php.net Reported By: lichunguo at ceopen dot cn -Status: Open +Status: Feedback Bug Type: Scripting Engine problem Operating System: Windows PHP Version: 5.2.6 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ Previous Comments: ------------------------------------------------------------------------ [2008-11-27 02:50:11] lichunguo at ceopen dot cn Description: ------------ Class b extends Class A, But Class A __construct is proviate Reproduce code: --------------- cclass a { public static function singles() { return new a; } private function __construct(){} public function test() { $class = 'b'; return new $class; } } class b extends a { public function getstr() { echo 'aaaaa'; } } $b = a::singles(); $obj = $b->test(); $obj->getstr(); Expected result: ---------------- Fatal error: Call to private a::__construct() from context 'a' Because Class b extends Class A, But Class A __construct is proviate. Actual result: -------------- Run above code: Windows: aaaaa Linux: Fatal error: Call to private a::__construct() from context 'a' in /data0/www/www/ui/member/receive.php on line 53 Why windows's result is ? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46693&edit=1

« previous php.bugs (#131440) next »