cvs: ZendEngine2 / zend_reflection_api.c
| From: | Marcus Boerger | Date: | Thu, 12 May 2005 21:25:42 +0000 |
| Subject: | cvs: ZendEngine2 / zend_reflection_api.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3653@lists.php.net to get a copy of this message | ||
helly Thu May 12 17:25:42 2005 EDT
Modified files:
/ZendEngine2 zend_reflection_api.c
Log:
- Make ReflectionObject::hasProperty() recognize dynamically added props
http://cvs.php.net/diff.php/ZendEngine2/zend_reflection_api.c?r1=1.152&r2=1.153&ty=u
Index: ZendEngine2/zend_reflection_api.c
diff -u ZendEngine2/zend_reflection_api.c:1.152 ZendEngine2/zend_reflection_api.c:1.153
--- ZendEngine2/zend_reflection_api.c:1.152 Mon Apr 25 01:13:36 2005
+++ ZendEngine2/zend_reflection_api.c Thu May 12 17:25:42 2005
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_reflection_api.c,v 1.152 2005/04/25 05:13:36 sebastian Exp $ */
+/* $Id: zend_reflection_api.c,v 1.153 2005/05/12 21:25:42 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
#include "zend_exceptions.h"
@@ -2656,6 +2656,7 @@
zend_class_entry *ce;
char *name;
int name_len;
+ zval *property;
METHOD_NOTSTATIC;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) ==
FAILURE) {
@@ -2666,6 +2667,16 @@
if (zend_hash_exists(&ce->properties_info, name, name_len + 1)) {
RETURN_TRUE;
} else {
+ if (intern->obj && Z_OBJ_HANDLER_P(intern->obj, has_property))
+ {
+ MAKE_STD_ZVAL(property);
+ ZVAL_STRINGL(property, name, name_len, 1);
+ if (Z_OBJ_HANDLER_P(intern->obj, has_property)(intern->obj, property, 2 TSRMLS_CC)) {
+ zval_ptr_dtor(&property);
+ RETURN_TRUE;
+ }
+ zval_ptr_dtor(&property);
+ }
RETURN_FALSE;
}
}