summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-10-21 16:13:09 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-10-22 11:26:02 +0200
commit530a8a38540e36a485f341d487529ade2b5d9c98 (patch)
treede5f307551d8c28159c0a63dac7ddcd3b0c8bfbd /Zend
parent1faea28cdd3677e47a0951367571bf51866105fd (diff)
downloadphp-git-530a8a38540e36a485f341d487529ade2b5d9c98.tar.gz
Fix and undeprecate ReflectionType::__toString()
Add deprecated _ZendTestClass::__toString() method to preserve an existing test. ReflectionType::__toString() will now return a complete representation of the type, as it should have originally. Users that relied on nullability being absent should have been pushed to ReflectionNamedType::getName() by the deprecation of ReflectionType::__toString() in PHP 7.1 / PHP 7.4.
Diffstat (limited to 'Zend')
-rw-r--r--Zend/tests/bug78239.phpt17
1 files changed, 5 insertions, 12 deletions
diff --git a/Zend/tests/bug78239.phpt b/Zend/tests/bug78239.phpt
index 94908a785b..aa81af4452 100644
--- a/Zend/tests/bug78239.phpt
+++ b/Zend/tests/bug78239.phpt
@@ -1,5 +1,7 @@
--TEST--
Bug #78239: Deprecation notice during string conversion converted to exception hangs
+--SKIPIF--
+<?php if (!extension_loaded("zend-test")) die("skip requires zend-test extension"); ?>
--FILE--
<?php
function handleError($level, $message, $file = '', $line = 0, $context = [])
@@ -9,21 +11,12 @@ function handleError($level, $message, $file = '', $line = 0, $context = [])
set_error_handler('handleError');
-class A
-{
-
- public function abc(): bool
- {
- return false;
- }
-}
-
-$r = new ReflectionMethod("A", "abc");
-(string)$r->getReturnType() ?: "";
+$r = new _ZendTestClass;
+(string)$r ?: "";
?>
--EXPECTF--
-Fatal error: Uncaught ErrorException: Function ReflectionType::__toString() is deprecated in %s:%d
+Fatal error: Uncaught ErrorException: Function _ZendTestClass::__toString() is deprecated in %s:%d
Stack trace:
#0 %s(%d): handleError(%s)
#1 {main}