mirror of
https://github.com/php/php-src.git
synced 2026-10-28 17:56:50 +08:00
60 lines
1.4 KiB
PHP
60 lines
1.4 KiB
PHP
--TEST--
|
|
Incorrectly initialized SimpleXmlElement
|
|
--EXTENSIONS--
|
|
simplexml
|
|
--FILE--
|
|
<?php
|
|
|
|
class MySXE extends SimpleXMLElement {
|
|
public function __construct() {
|
|
/* yolo */
|
|
}
|
|
}
|
|
|
|
$sxe = new MySXE;
|
|
try {
|
|
var_dump($sxe->count());
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
var_dump($sxe->xpath(''));
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
var_dump($sxe->getDocNamespaces());
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
var_dump($sxe->children());
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
var_dump($sxe->attributes());
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
var_dump($sxe->registerXPathNamespace('', ''));
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), "\n";
|
|
}
|
|
try {
|
|
var_dump($sxe->foo);
|
|
} catch (Throwable $e) {
|
|
echo $e::class, ': ', $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Error: SimpleXMLElement is not properly initialized
|
|
Error: SimpleXMLElement is not properly initialized
|
|
Error: SimpleXMLElement is not properly initialized
|
|
Error: SimpleXMLElement is not properly initialized
|
|
Error: SimpleXMLElement is not properly initialized
|
|
Error: SimpleXMLElement is not properly initialized
|
|
Error: SimpleXMLElement is not properly initialized
|