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