php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46693 inherit Parent's private, not report error
Submitted: 2008-11-27 02:50 UTC Modified: 2008-12-06 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: lichunguo at ceopen dot cn Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 5.2.6 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: lichunguo at ceopen dot cn
New email:
PHP Version: OS:

 

 [2008-11-27 02:50 UTC] 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 ?

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-28 12:34 UTC] 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-29 04:43 UTC] lichunguo at ceopen dot cn
I have tried, but no solve probleam, as of old.
 [2008-12-06 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 13 12:01:31 2025 UTC