mirror of
https://github.com/php/php-src.git
synced 2026-03-24 16:22:37 +01:00
This is in preparation for the possible future transformation of `clone` into a function call, but also meaningful on its own, since the purpose of the tests is not to test the stack trace generation, but rather that an exception was thrown. It also cleans up some unreachable code in the tests.
23 lines
400 B
PHP
23 lines
400 B
PHP
--TEST--
|
|
Bug #51936 (Crash with clone XMLReader)
|
|
--EXTENSIONS--
|
|
xmlreader
|
|
--FILE--
|
|
<?php
|
|
|
|
$xmlreader = new XMLReader();
|
|
$xmlreader->xml("<a><b/></a>");
|
|
|
|
$xmlreader->next();
|
|
|
|
try {
|
|
$xmlreader2 = clone $xmlreader;
|
|
$xmlreader2->next();
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ": ", $e->getMessage(), PHP_EOL;
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Error: Trying to clone an uncloneable object of class XMLReader
|