Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 93f94b6

Browse files
committed
Don't mark ReflectionType::__toString() as deprecated for now
1 parent 289d1ab commit 93f94b6

3 files changed

Lines changed: 6 additions & 12 deletions

File tree

ext/reflection/php_reflection.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6701,7 +6701,10 @@ static const zend_function_entry reflection_type_functions[] = {
67016701
ZEND_ME(reflection, __clone, arginfo_reflection__void, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
67026702
ZEND_ME(reflection_type, allowsNull, arginfo_reflection__void, 0)
67036703
ZEND_ME(reflection_type, isBuiltin, arginfo_reflection__void, 0)
6704-
ZEND_ME(reflection_type, __toString, arginfo_reflection__void, ZEND_ACC_DEPRECATED)
6704+
/* ReflectionType::__toString() is deprecated, but we currently do not mark it as such
6705+
* due to bad interaction with the PHPUnit error handler and exceptions in __toString().
6706+
* See PR2137. */
6707+
ZEND_ME(reflection_type, __toString, arginfo_reflection__void, 0)
67056708
PHP_FE_END
67066709
};
67076710

ext/reflection/tests/ReflectionNamedType.phpt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,12 @@ var_dump($return->getName());
3030
var_dump((string) $return);
3131

3232
?>
33-
--EXPECTF--
33+
--EXPECT--
3434
string(11) "Traversable"
35-
36-
Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d
3735
string(11) "Traversable"
3836
string(6) "string"
39-
40-
Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d
4137
string(6) "string"
4238
string(4) "Test"
43-
44-
Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d
4539
string(4) "Test"
4640
string(4) "Test"
47-
48-
Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d
4941
string(4) "Test"

ext/reflection/tests/bug72661.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ function test(iterable $arg) { }
66

77
var_dump((string)(new ReflectionParameter("test", 0))->getType());
88
?>
9-
--EXPECTF--
10-
Deprecated: Function ReflectionType::__toString() is deprecated in %s on line %d
9+
--EXPECT--
1110
string(8) "iterable"

0 commit comments

Comments
 (0)