xref: /PHP-8.1/Zend/tests/bug78239.phpt (revision 74859783)
1--TEST--
2Bug #78239: Deprecation notice during string conversion converted to exception hangs
3--EXTENSIONS--
4zend_test
5--FILE--
6<?php
7function handleError($level, $message, $file = '', $line = 0, $context = [])
8{
9    throw new ErrorException($message, 0, $level, $file, $line);
10}
11
12set_error_handler('handleError');
13
14$r = new _ZendTestClass;
15(string)$r ?: "";
16
17?>
18--EXPECTF--
19Fatal error: Uncaught ErrorException: Method _ZendTestClass::__toString() is deprecated in %s:%d
20Stack trace:
21#0 %s(%d): handleError(%s)
22#1 {main}
23  thrown in %s on line %d
24