Any idea if ext/reflection is Unicode-ready or how much work it needs to get there?

-Andrei

On Oct 6, 2006, at 11:02 AM, Antony Dovgal wrote:

tony2001                Fri Oct  6 18:02:51 2006 UTC

  Modified files:
    /php-src/ext/reflection     php_reflection.c
    /php-src/ext/reflection/tests       bug39067.phpt
  Log:
  more improvements


http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c? r1=1.259&r2=1.260&diff_format=u
Index: php-src/ext/reflection/php_reflection.c
diff -u php-src/ext/reflection/php_reflection.c:1.259 php-src/ext/reflection/php_reflection.c:1.260 --- php-src/ext/reflection/php_reflection.c:1.259 Fri Oct 6 17:34:56 2006
+++ php-src/ext/reflection/php_reflection.c     Fri Oct  6 18:02:50 2006
@@ -20,7 +20,7 @@
+---------------------------------------------------------------------- +
 */

-/* $Id: php_reflection.c,v 1.259 2006/10/06 17:34:56 tony2001 Exp $ */
+/* $Id: php_reflection.c,v 1.260 2006/10/06 18:02:50 tony2001 Exp $ */

 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -4099,12 +4099,12 @@
        prop_name_len = USTR_LEN(prop_name);
        ce = tmp_ce = ref->ce;
while (tmp_ce && zend_u_hash_find(&tmp_ce->properties_info, UG(unicode)?IS_UNICODE:IS_STRING, prop_name, prop_name_len + 1, (void **) &tmp_info) == SUCCESS) {
-               ce = tmp_ce;
-               tmp_ce = tmp_ce->parent;
                if (tmp_info->flags & ZEND_ACC_PRIVATE) {
                        /* it's a private property, so it can't be inherited */
                        break;
                }
+               ce = tmp_ce;
+               tmp_ce = tmp_ce->parent;
        }

        zend_reflection_class_factory(ce, return_value TSRMLS_CC);
@@ -4913,7 +4913,7 @@
        php_info_print_table_start();
        php_info_print_table_header(2, "Reflection", "enabled");

- php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.259 2006/10/06 17:34:56 tony2001 Exp $"); + php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.260 2006/10/06 18:02:50 tony2001 Exp $");

        php_info_print_table_end();
 } /* }}} */
http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/ bug39067.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/reflection/tests/bug39067.phpt
diff -u php-src/ext/reflection/tests/bug39067.phpt:1.1 php-src/ext/reflection/tests/bug39067.phpt:1.2 --- php-src/ext/reflection/tests/bug39067.phpt:1.1 Fri Oct 6 17:34:56 2006
+++ php-src/ext/reflection/tests/bug39067.phpt  Fri Oct  6 18:02:50 2006
@@ -24,15 +24,28 @@
 $rc = new ReflectionClass('A');
 var_dump($rc->getProperty('x')->getDeclaringClass()->getName());

+class Test {
+       private $x;
+}
+
+class Test2 extends Test {
+       public $x;
+}
+
+$rc = new ReflectionClass('Test2');
+var_dump($rc->getProperty('x')->getDeclaringClass()->getName());
+
 echo "Done\n";
 ?>
 --EXPECTF--    
 string(1) "C"
 string(1) "B"
 string(1) "A"
+string(5) "Test2"
 Done
 --UEXPECTF--
 unicode(1) "C"
 unicode(1) "B"
 unicode(1) "A"
+unicode(4) "Test2"
 Done

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to