xref: /PHP-8.0/Zend/tests/bug78239.phpt (revision 93640db4)
1--TEST--
2Bug #78239: Deprecation notice during string conversion converted to exception hangs
3--SKIPIF--
4<?php if (!extension_loaded("zend-test")) die("skip requires zend-test extension"); ?>
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