]> granicus.if.org Git - php/commitdiff
Don't mark ReflectionType::__toString() as deprecated for now
authorNikita Popov <nikic@php.net>
Tue, 27 Sep 2016 17:26:50 +0000 (19:26 +0200)
committerNikita Popov <nikic@php.net>
Wed, 28 Sep 2016 17:21:53 +0000 (19:21 +0200)
ext/reflection/php_reflection.c
ext/reflection/tests/ReflectionNamedType.phpt
ext/reflection/tests/bug72661.phpt

index 47c09d4521a9bc308c0ec6be69fa05b1305d3fcb..52d35409d3f5cf5bbd405e7bdffb0bc11eaf817e 100644 (file)
@@ -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
 };
 
index afb592127c3863b4afb8ffe69ec80dd5349a9622..a40d4066ec3292ac96787b7669eeb2124c3243ac 100644 (file)
@@ -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"
index 1522c5f201d6aa7985cf6a0b8e0c36eefd048c57..40d14922b81ad11d3ea8ca8b609ce0a78f9b2ef3 100644 (file)
@@ -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"