Bug #69220 [Nab]: _call, __construct, __set
| From: | cybermerlin at ya dot ru | Date: | Fri, 13 Mar 2015 07:22:48 +0000 |
| Subject: | Bug #69220 [Nab]: _call, __construct, __set | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-191366@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69220&edit=1
ID: 69220
User updated by: cybermerlin at ya dot ru
Reported by: cybermerlin at ya dot ru
Summary: _call, __construct, __set
Status: Not a bug
Type: Bug
Package: Class/Object related
Operating System: winx64_8.1
PHP Version: 5.6.6
Block user comment: N
Private report: N
New Comment:
oh, thanks. I'm sorry
I have no more questions
Previous Comments:
------------------------------------------------------------------------
[2015-03-13 07:11:16] requinix@php.net
http://php.net/manual/en/language.oop5.overloading.php#object.call
>__call() is triggered when invoking inaccessible methods in an object context.
------------------------------------------------------------------------
[2015-03-13 06:22:15] cybermerlin at ya dot ru
I was expecting at least the message of two calls: setField1 and hasField1.
why there is no information about the call setField1?
------------------------------------------------------------------------
[2015-03-13 02:03:53] requinix@php.net
As do I. hasField1 is the only method that does not exist/is not accessible, and it is only called
once. What's the problem?
------------------------------------------------------------------------
[2015-03-12 12:21:58] cybermerlin at ya dot ru
But what about question 2)?
I see only hasField1 call
------------------------------------------------------------------------
[2015-03-12 10:52:00] requinix@php.net
get_class_vars() will not show you private variables unless you call it from within their defining
class. While you could call it from within the child in abstract "helper" method, the
parent would still not have access to the variable and would thus error.
On the other hand, protected variables *are* accessible from parents so you could make the variable
protected and the code would work.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=69220
--
Edit this bug report at https://bugs.php.net/bug.php?id=69220&edit=1