xref: /PHP-7.4/Zend/tests/bug78239.phpt (revision 2bf880db)
1--TEST--
2Bug #78239: Deprecation notice during string conversion converted to exception hangs
3--FILE--
4<?php
5function handleError($level, $message, $file = '', $line = 0, $context = [])
6{
7    throw new ErrorException($message, 0, $level, $file, $line);
8}
9
10set_error_handler('handleError');
11
12class A
13{
14
15    public function abc(): bool
16    {
17        return false;
18    }
19}
20
21$r = new ReflectionMethod("A", "abc");
22(string)$r->getReturnType() ?: "";
23
24?>
25--EXPECTF--
26Fatal error: Uncaught ErrorException: Function ReflectionType::__toString() is deprecated in %s:%d
27Stack trace:
28#0 %s(%d): handleError(%s)
29#1 {main}
30  thrown in %s on line %d
31