xref: /PHP-8.4/ext/xmlreader/tests/bug51936.phpt (revision 39131219)
1--TEST--
2Bug #51936 (Crash with clone XMLReader)
3--EXTENSIONS--
4xmlreader
5--FILE--
6<?php
7echo "Test\n";
8
9$xmlreader = new XMLReader();
10$xmlreader->xml("<a><b/></a>");
11
12$xmlreader->next();
13$xmlreader2 = clone $xmlreader;
14$xmlreader2->next();
15?>
16Done
17--EXPECTF--
18Test
19
20Fatal error: Uncaught Error: Trying to clone an uncloneable object of class XMLReader in %s:%d
21Stack trace:
22#0 {main}
23  thrown in %s on line %d
24