felipe Mon Aug 11 00:50:03 2008 UTC Added files: (Branch: PHP_5_2) /php-src/ext/reflection/tests bug45765.phpt
Modified files: /php-src/ext/reflection php_reflection.c Log: - MFH: Fixed bug #45765 (ReflectionObject with default parameters of self::xxx cause an error) http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.51&r2=1.164.2.33.2.52&diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.51 php-src/ext/reflection/php_reflection.c:1.164.2.33.2.52 --- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.51 Sun Jun 1 03:08:59 2008 +++ php-src/ext/reflection/php_reflection.c Mon Aug 11 00:50:02 2008 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_reflection.c,v 1.164.2.33.2.51 2008/06/01 03:08:59 felipe Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.33.2.52 2008/08/11 00:50:02 felipe Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -634,7 +634,7 @@ *zv = precv->op2.u.constant; zval_copy_ctor(zv); INIT_PZVAL(zv); - zval_update_constant(&zv, (void*)1 TSRMLS_CC); + zval_update_constant_ex(&zv, (void*)1, fptr->common.scope TSRMLS_CC); if (Z_TYPE_P(zv) == IS_BOOL) { if (Z_LVAL_P(zv)) { string_write(str, "true", sizeof("true")-1); @@ -4908,7 +4908,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.164.2.33.2.51 2008/06/01 03:08:59 felipe Exp $"); + php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v 1.164.2.33.2.52 2008/08/11 00:50:02 felipe Exp $"); php_info_print_table_end(); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/bug45765.phpt?view=markup&rev=1.1 Index: php-src/ext/reflection/tests/bug45765.phpt +++ php-src/ext/reflection/tests/bug45765.phpt --TEST-- Fixed bug #45765 (ReflectionObject with default parameters of self::xxx cause an error) --FILE-- <?php class foo2 { const BAR = 'foobar'; } class foo extends foo2 { const BAR = "foo's bar"; function test($a = self::BAR) { } function test2($a = parent::BAR) { } function test3($a = foo::BAR) { } function test4($a = foo2::BAR) { } } ReflectionObject::export(new foo); ?> --EXPECTF-- Object of class [ <user> class foo extends foo2 ] { @@ %s 7-21 - Constants [1] { Constant [ Unicode string BAR ] { foo's bar } } - Static properties [0] { } - Static methods [0] { } - Properties [0] { } - Dynamic properties [0] { } - Methods [4] { Method [ <user> public method test ] { @@ %s 10 - 11 - Parameters [1] { Parameter #0 [ <optional> $a = 'foo's bar' ] } } Method [ <user> public method test2 ] { @@ %s 13 - 14 - Parameters [1] { Parameter #0 [ <optional> $a = 'foobar' ] } } Method [ <user> public method test3 ] { @@ %s 16 - 17 - Parameters [1] { Parameter #0 [ <optional> $a = 'foo's bar' ] } } Method [ <user> public method test4 ] { @@ %s 19 - 20 - Parameters [1] { Parameter #0 [ <optional> $a = 'foobar' ] } } } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php