cvs: php-src(PHP_5_3) /ext/reflection php_reflection.c /ext/reflection/tests bug45765.phpt
| From: | Felipe Pena | Date: | Mon, 11 Aug 2008 00:47:45 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /ext/reflection php_reflection.c /ext/reflection/tests bug45765.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-52191@lists.php.net to get a copy of this message | ||
felipe Mon Aug 11 00:47:45 2008 UTC
Added files: (Branch: PHP_5_3)
/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.45.2.27&r2=1.164.2.33.2.45.2.28&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.45.2.27
php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.28
--- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.45.2.27 Fri Aug 8 10:52:48 2008
+++ php-src/ext/reflection/php_reflection.c Mon Aug 11 00:47:45 2008
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.27 2008/08/08 10:52:48 felixdv Exp $ */
+/* $Id: php_reflection.c,v 1.164.2.33.2.45.2.28 2008/08/11 00:47:45 felipe Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -642,7 +642,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);
@@ -5117,7 +5117,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.45.2.27 2008/08/08 10:52:48 felixdv Exp $");
+ php_info_print_table_row(2, "Version", "$Id: php_reflection.c,v
1.164.2.33.2.45.2.28 2008/08/11 00:47:45 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' ]
}
}
}
}