summaryrefslogtreecommitdiff
path: root/Zend/tests/bug78239.phpt
blob: 1ecad6746036a4d67acc29bd262d4141abf936c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--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 = [])
{
    throw new ErrorException($message, 0, $level, $file, $line);
}

set_error_handler('handleError');

$r = new _ZendTestClass;
(string)$r ?: "";

?>
--EXPECTF--
Fatal error: Uncaught ErrorException: Method _ZendTestClass::__toString() is deprecated in %s:%d
Stack trace:
#0 %s(%d): handleError(%s)
#1 {main}
  thrown in %s on line %d