mirror of
https://github.com/php/php-src.git
synced 2026-10-28 17:56:50 +08:00
57 lines
1.5 KiB
PHP
57 lines
1.5 KiB
PHP
--TEST--
|
|
Test property write errors
|
|
--EXTENSIONS--
|
|
dom
|
|
--FILE--
|
|
<?php
|
|
require_once("dom_test.inc");
|
|
|
|
$dom = new DOMDocument();
|
|
|
|
try {
|
|
$dom->nodeValue = [];
|
|
} catch (Throwable $exception) {
|
|
echo $exception::class, ': ', $exception->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
$dom->nodeType += 1;
|
|
} catch (Throwable $exception) {
|
|
echo $exception::class, ': ', $exception->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
$dom->xmlEncoding = null;
|
|
} catch (Throwable $exception) {
|
|
echo $exception::class, ': ', $exception->getMessage(), "\n";
|
|
}
|
|
|
|
$entity = new DOMEntity();
|
|
|
|
try {
|
|
$entity->actualEncoding = null;
|
|
} catch (Throwable $exception) {
|
|
echo $exception::class, ': ', $exception->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
$entity->encoding = null;
|
|
} catch (Throwable $exception) {
|
|
echo $exception::class, ': ', $exception->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
$entity->version = null;
|
|
} catch (Throwable $exception) {
|
|
echo $exception::class, ': ', $exception->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
TypeError: Cannot assign array to property DOMNode::$nodeValue of type ?string
|
|
Error: Cannot modify private(set) property DOMNode::$nodeType from global scope
|
|
Error: Cannot modify private(set) property DOMDocument::$xmlEncoding from global scope
|
|
Error: Cannot modify private(set) property DOMEntity::$actualEncoding from global scope
|
|
Error: Cannot modify private(set) property DOMEntity::$encoding from global scope
|
|
Error: Cannot modify private(set) property DOMEntity::$version from global scope
|