#46693 [Com]: inherit Parent's private, not report error
| From: | lichunguo at ceopen dot cn | Date: | Sat, 29 Nov 2008 04:43:51 +0000 |
| Subject: | #46693 [Com]: inherit Parent's private, not report error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-131470@lists.php.net to get a copy of this message | ||
ID: 46693
Comment by: lichunguo at ceopen dot cn
Reported By: lichunguo at ceopen dot cn
Status: Feedback
Bug Type: Scripting Engine problem
Operating System: Windows
PHP Version: 5.2.6
New Comment:
I have tried, but no solve probleam, as of old.
Previous Comments:
------------------------------------------------------------------------
[2008-11-28 12:34:41] jani@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
------------------------------------------------------------------------
[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