Hi, the following script: <?php class Singleton { public static $instance = NULL; } $c= new ReflectionClass('Singleton'); var_dump($c->getProperty('instance')->getValue()); ?>
prints "UNKNOWN:0" - expected behaviour would be to print "NULL". Attached is a diff against zend_reflection_api.c which fixes this. -- Timm If it ain't broken, it doesn't have enough features yet
Index: Zend/zend_reflection_api.c =================================================================== RCS file: /repository/ZendEngine2/zend_reflection_api.c,v retrieving revision 1.149 diff -u -r1.149 zend_reflection_api.c --- Zend/zend_reflection_api.c 27 Feb 2005 22:21:17 -0000 1.149 +++ Zend/zend_reflection_api.c 6 Mar 2005 12:15:51 -0000 @@ -3358,6 +3358,7 @@ } if ((ref->prop->flags & ZEND_ACC_STATIC)) { + zend_update_class_constants(intern->ce TSRMLS_CC); if (zend_hash_quick_find(intern->ce->static_members, ref->prop->name, ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) { zend_error(E_ERROR, "Internal error: Could not find the property %s", ref->prop->name); /* Bails out */
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php