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] larue...@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] larue...@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

Reply via email to