php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53172 ZEND_ACC_IMPLICIT_PUBLIC should be removed or used in zend_get_property_info
Submitted: 2010-10-26 18:34 UTC Modified: 2020-01-08 13:35 UTC
From: cataphract@php.net Assigned: nikic (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.3SVN-2010-10-26 (SVN) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
49 - 32 = ?
Subscribe to this entry?

 
 [2010-10-26 18:34 UTC] cataphract@php.net
Description:
------------
The status of the flag ZEND_ACC_IMPLICIT_PUBLIC is somewhat unclear. In the ZE:

* PHP 5.3 checks for it in a few places, but doesn't set it anymore as the body of zend_do_declare_implicit_property is commented out.
* trunk retains only the definition of ZEND_ACC_IMPLICIT_PUBLIC, everything else is gone.

So it seems that the flag ZEND_ACC_IMPLICIT_PUBLIC, apparently originally used to signal dynamic properties, is only used by the reflection extension. The reflection extension, not being able to depend on the Zend Engine to set it, sets the flag itself when it finds a dynamic property, i.e. a property that is in the object hash table but has no property_info (ReflectionProperty::__construct and ReflectionClass::getProperty).

This would be unnecessary if zend_get_property_info set the flag ZEND_ACC_IMPLICIT_PUBLIC over here:

http://lxr.php.net/opengrok/xref/PHP_TRUNK/Zend/zend_object_handlers.c#310

In that case, the reflection extension could just call zend_get_property_info and not do directly lookups in ce->properties_info. Though right now it would be possible to call zend_get_property_info and check for equality to &EG(property_info), this is suboptimal.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-26 20:25 UTC] cataphract@php.net
I recall the last paragraph, zend_get_property_info is not an alternative for reflection because of the access checks (except for _adddynproperty).
 [2020-01-08 13:35 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2020-01-08 13:35 UTC] nikic@php.net
The flag has been removed in the meantime.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC