summaryrefslogtreecommitdiff
path: root/ext/xmlreader/tests/bug51936.phpt
blob: 619b9ec1d9e6f0f20b613f934e7696b12b7cbb5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--TEST--
Bug #51936 (Crash with clone XMLReader)
--SKIPIF--
<?php
extension_loaded("xmlreader") or die("skip requires xmlreader");
?>
--FILE--
<?php
echo "Test\n";

$xmlreader = new XMLReader();
$xmlreader->xml("<a><b/></a>");

$xmlreader->next();
$xmlreader2 = clone $xmlreader;
$xmlreader2->next();
?>
Done
--EXPECTF--
Test

Fatal error: Uncaught exception 'EngineException' with message 'Trying to clone an uncloneable object of class XMLReader' in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d