Doc #65071 [Opn->Nab]: magic __call not implemented as documented
| From: | krakjoe@php.net | Date: | Fri, 04 Oct 2013 17:26:46 +0000 |
| Subject: | Doc #65071 [Opn->Nab]: magic __call not implemented as documented | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10415@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65071&edit=1
ID: 65071
Updated by: krakjoe@php.net
Reported by: simong at ganz dot com
Summary: magic __call not implemented as documented
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: Reflection related
PHP Version: 5.3.26
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2013-06-20 15:47:41] simong at ganz dot com
Description:
------------
---
From manual page: http://php.net/manual/en/language.oop5.magic.php
---
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:
---------------
<?php
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";
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65071&edit=1