1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 15:38:49 +02:00
Files
archived-php-src/ext/tidy/tests/uninitialized.phpt
T
Nikita Popov d4bf0799b8 Don't crash on uninitialized tidy object
"Uninitialized" here means that the object was created ordinarily
-- no constructor skipping involved. Most tidy methods seem to
handle this fine, but these three need to be guarded.
2020-10-22 16:04:22 +02:00

30 lines
539 B
PHP

--TEST--
Operations on uninitialized tidy object
--SKIPIF--
<?php if (!extension_loaded("tidy")) print "skip"; ?>
--FILE--
<?php
$tidy = new tidy;
try {
var_dump($tidy->getHtmlVer());
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump($tidy->isXhtml());
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
try {
var_dump($tidy->isXml());
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
tidy object is not initialized
tidy object is not initialized
tidy object is not initialized