1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/dom/tests/gh16316.phpt
2024-10-10 19:28:20 +02:00

33 lines
502 B
PHP

--TEST--
GH-16316 (DOMXPath breaks when not initialized properly)
--EXTENSIONS--
dom
--FILE--
<?php
class Demo extends DOMXPath {
public function __construct() {}
}
$demo = new Demo;
try {
var_dump($demo);
} catch (DOMException $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump($demo->document);
} catch (DOMException $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
object(Demo)#1 (1) {
["registerNodeNamespaces"]=>
bool(true)
}
Invalid State Error
Invalid State Error