Bug #55731 [Bgs]: __get after __unset
| From: | 421034509 at qq dot com | Date: | Thu, 22 Sep 2011 01:18:53 +0000 |
| Subject: | Bug #55731 [Bgs]: __get after __unset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-163767@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55731&edit=1
ID: 55731
User updated by: 421034509 at qq dot com
Reported by: 421034509 at qq dot com
Summary: __get after __unset
Status: Bogus
Type: Bug
Package: Unknown/Other Function
Operating System: windows xp
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
When get_property_info successed in the Example class,
if the private property is defined but be unsetted,zend vm return a property info with name
"\0Example\0propertyname",
but if the property is undefined(or defined but not be unsetted),zend vm return a property info with
name "propertyname".
Is that true?
Previous Comments:
------------------------------------------------------------------------
[2011-09-22 01:17:55] laruence@php.net
because there is no '\0Example\0p3' in property_info of Example class entry
------------------------------------------------------------------------
[2011-09-21 16:51:52] hytest at gmail dot com
If we add following code:
echo $example->p3;
It still just call __get once. Why it doesn't call it twice?
( one for "p3" and one for "\0example\0p3" ? )
In another word: what's the different between a property not defined and a unset
private property?
------------------------------------------------------------------------
[2011-09-21 09:02:15] 421034509 at qq dot com
Thank you very much!You are so kind and patient!
I see your blog!
It's great!
æ¨ä¹æ¯ä¸å½äººåï¼
æç°å¨å¤§åï¼ç°å¨å¨å京å¦ä¹ ï¼åæ¥è§¦php!叿以åè¿è½è¯·ææ¨ï¼
------------------------------------------------------------------------
[2011-09-21 08:07:48] laruence@php.net
kind of right, you can refer to zend_std_read_property(in
Zend/zend_object_handlers.c) for more details.
and btw, you seems to be a chinese(using qq email), so if you are interesting of
php internal, plz look at laruence.com, I will write these down in chinese in
couple of days
------------------------------------------------------------------------
[2011-09-21 07:42:19] 421034509 at qq dot com
p1:
You mean __unset() made the p1 out of $example->properties?
When get_property_info successed,
zend vm return a property info with name "\0Example\0p1"
but it can't find p1 in $example->properties ?
So zend vm try to fetch "\0Example\0p1" and set a getter_guard for
"\0Example\0p1" and call getter again.
p2:
When get_property_info successed,
zend vm return a property info with name "\0Example\0p2"
and p2 can be found in $example->properties.
So zend vm wont try to fetch "\0Example\0p1" but successed and return p2?
------------------------------------------------------------------------
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=55731
--
Edit this bug report at https://bugs.php.net/bug.php?id=55731&edit=1