|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65071 magic __call not implemented as documented
Submitted: 2013-06-20 15:47 UTC Modified: 2013-10-04 17:26 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: simong at ganz dot com Assigned:
Status: Not a bug Package: Reflection related
PHP Version: 5.3.26 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: simong at ganz dot com
New email:
PHP Version: OS:


 [2013-06-20 15:47 UTC] simong at ganz dot com
From manual page:
Reflected invocation of protected method fails with:

"PHP Fatal error:  Uncaught exception 'ReflectionException' with message 'Trying to invoke protected method"

Documentation says:

"__call() is triggered when invoking inaccessible methods in an object context."

Should read:

"__call() is triggered when invoking invisible methods in an object context."

Test script:
class test {
	public function __call($name, $args) {
		return 123;

class testdev extends test {
	protected function cansee() {
		return 456;

$x = new testdev();
$r = new ReflectionMethod($x, 'cansee');

echo $r->invoke($x) . "\n";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-04 17:26 UTC]
-Status: Open +Status: Not a bug
 [2013-10-04 17:26 UTC]
This is just semantics; I don't see a need to change them.

Technically, private/protected/public are in fact access modifiers and not visibility modifiers ... method_exists, or just method calls illustrate this, from a context where a protected method is not accessible it is still visible.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 15 14:01:28 2024 UTC