com php-src: Don't mark ReflectionType::__toString( ) as deprecated for now: ext/reflection/php_ref lection.c
ext/reflection/tests/ReflectionNamedType.phpt ext/reflection/tests/bug72661.phpt

From: Date: Wed, 28 Sep 2016 17:21:53 +0000
Subject: com php-src: Don't mark ReflectionType::__toString( ) as deprecated for now: ext/reflection/php_ref lection.c
ext/reflection/tests/ReflectionNamedType.phpt ext/reflection/tests/bug72661.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-94733@lists.php.net to get a copy of this message
Commit: f70fb05138e9d5dd2126eadec0377abf705dec74 Author: Nikita Popov <nikic@php.net> Tue, 27 Sep 2016 19:26:50 +0200 Parents: bf907b9961000dfb9b3bf3bd8a1e00e327a8268e Branches: PHP-7.1 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f70fb05138e9d5dd2126eadec0377abf705dec74 Log: Don't mark ReflectionType::__toString() as deprecated for now Changed paths: M ext/reflection/php_reflection.c M ext/reflection/tests/ReflectionNamedType.phpt M ext/reflection/tests/bug72661.phpt Diff: diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 47c09d4..52d3540 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -6701,7 +6701,10 @@ static const zend_function_entry reflection_type_functions[] = { ZEND_ME(reflection, __clone, arginfo_reflection__void, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) ZEND_ME(reflection_type, allowsNull, arginfo_reflection__void, 0) ZEND_ME(reflection_type, isBuiltin, arginfo_reflection__void, 0) - ZEND_ME(reflection_type, __toString, arginfo_reflection__void, ZEND_ACC_DEPRECATED) + /* ReflectionType::__toString() is deprecated, but we currently do not mark it as such + * due to bad interaction with the PHPUnit error handler and exceptions in __toString(). + * See PR2137. */ + ZEND_ME(reflection_type, __toString, arginfo_reflection__void, 0) PHP_FE_END }; diff --git a/ext/reflection/tests/ReflectionNamedType.phpt b/ext/reflection/tests/ReflectionNamedType.phpt index afb5921..a40d406 100644 --- a/ext/reflection/tests/ReflectionNamedType.phpt +++ b/ext/reflection/tests/ReflectionNamedType.phpt @@ -30,20 +30,12 @@ var_dump($return->getName()); var_dump((string) $return); ?> ---EXPECTF-- +--EXPECT-- string(11) "Traversable" - -Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d string(11) "Traversable" string(6) "string" - -Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d string(6) "string" string(4) "Test" - -Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d string(4) "Test" string(4) "Test" - -Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d string(4) "Test" diff --git a/ext/reflection/tests/bug72661.phpt b/ext/reflection/tests/bug72661.phpt index 1522c5f..40d1492 100644 --- a/ext/reflection/tests/bug72661.phpt +++ b/ext/reflection/tests/bug72661.phpt @@ -6,6 +6,5 @@ function test(iterable $arg) { } var_dump((string)(new ReflectionParameter("test", 0))->getType()); ?> ---EXPECTF-- -Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d +--EXPECT-- string(8) "iterable"

« previous php.cvs (#94733) next »