summaryrefslogtreecommitdiff
path: root/Zend/tests/bug78239.phpt
blob: 50dd46c97111f93a951fcd4c7003b124c512421c (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