|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-22 05:01 UTC] aharvey@php.net
-Status: Open
+Status: Bogus
[2010-07-22 05:01 UTC] aharvey@php.net
[2010-07-22 07:00 UTC] laszlo dot janszky at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 07:00:02 2025 UTC |
Description: ------------ Maybe it's not a bug, but I cannot call private or protected methods from within a class by ReflectionClass. Test script: --------------- <?php

class Test
{
	static public function instance()
	{
		$class=new ReflectionClass(get_called_class());
		return $class->newInstanceArgs(func_get_args());
	}
	
	private function __construct()
	{}
}

Test::instance(); Expected result: ---------------- Create a new instance. Actual result: -------------- Fatal error: Uncaught exception 'ReflectionException' with message 'Access to non-public constructor of class Test'