summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-09-02 14:46:02 +0000
committerMarcus Boerger <helly@php.net>2003-09-02 14:46:02 +0000
commit560d3ab36a95a5f9b1895c34beafaf681754a588 (patch)
tree503e35132eedf4da977dae8cf7436fc6051c18bd /ext/reflection/php_reflection.c
parent7148cb9e730e87e0b37eb9cdc82398aaa164003b (diff)
downloadphp-git-560d3ab36a95a5f9b1895c34beafaf681754a588.tar.gz
Use appropriate function for property name unmangling.
# Make Andrey happy
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index c028c4214c..1c6780f52a 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -429,6 +429,8 @@ static void _function_string(string *str, zend_function *fptr, char* indent TSRM
static void _property_string(string *str, zend_property_info *prop, char* indent TSRMLS_DC)
{
+ char *class_name, *prop_name;
+
string_printf(str, "%sProperty [ %s", indent,
(prop->flags & ZEND_ACC_IMPLICIT_PUBLIC) ? "<implicit> " : "<default> ");
@@ -447,15 +449,9 @@ static void _property_string(string *str, zend_property_info *prop, char* indent
if(prop->flags & ZEND_ACC_STATIC) {
string_printf(str, "static ");
}
- /* Unmangle the property name if necessary */
- string_printf(str, "$");
- if (prop->name[0] != 0) {
- string_write(str, prop->name, prop->name_length);
- } else {
- char* tmp;
- tmp= prop->name + 1;
- string_printf(str, tmp + strlen(tmp) + 1);
- }
+
+ unmangle_property_name(prop->name, &class_name, &prop_name);
+ string_printf(str, "$%s", prop_name);
string_printf(str, " ]\n");
}
@@ -579,18 +575,13 @@ void reflection_property_factory(zend_class_entry *ce, zend_property_info *prop,
zval *name;
zval *classname;
property_reference *reference;
+ char *class_name, *prop_name;
- MAKE_STD_ZVAL(name);
+ unmangle_property_name(prop->name, &class_name, &prop_name);
- /* Unmangle the property name if necessary */
- if (prop->name[0] != 0) {
- ZVAL_STRINGL(name, prop->name, prop->name_length, 1);
- } else {
- char* tmp;
+ MAKE_STD_ZVAL(name);
+ ZVAL_STRING(name, prop_name, 1);
- tmp= prop->name + 1;
- ZVAL_STRING(name, tmp + strlen(tmp) + 1, 1);
- }
MAKE_STD_ZVAL(classname);
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
reflection_instanciate(reflection_property_ptr, object TSRMLS_CC);