1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 17:08:14 +02:00
Files
archived-php-src/Zend/tests/gh16188.phpt
T
Arnaud Le Blanc c2115a43e3 Handle references properties of the Exception class
Fixes GH-16188
Closes GH-16196
2024-10-07 15:03:31 +02:00

35 lines
600 B
PHP

--TEST--
GH-16188 (Assertion failure in Zend/zend_exceptions.c)
--FILE--
<?php
$re = new TypeError();
array_walk($re, function (&$item, $key) use (&$re) {
if ($key === "\x00Error\x00previous") {
$item = new Exception();
}
});
printf("getTraceAsString:\n%s\n\n", $re->getTraceAsString());
printf("getPrevious:\n%s\n\n", get_class($re->getPrevious()));
printf("__toString:\n%s\n\n", $re);
?>
==DONE==
--EXPECTF--
getTraceAsString:
#0 {main}
getPrevious:
Exception
__toString:
Exception in %s:%d
Stack trace:%A
#%d {main}
Next TypeError in %s:%d
Stack trace:%A
#%d {main}
==DONE==