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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
--TEST--
XSLTProcessor::$maxTemplateVars errors
--EXTENSIONS--
xsl
--INI--
error_reporting=E_ALL & ~E_DEPRECATED
--FILE--
<?php
$processor = new XSLTProcessor;
$oldValue = $processor->maxTemplateVars;
try {
$processor->maxTemplateVars = -1;
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
var_dump($processor->maxTemplateVars === $oldValue);
try {
$processor->maxTemplateVars = -32.1;
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
var_dump($processor->maxTemplateVars === $oldValue);
try {
$processor->maxTemplateVars = "-1";
} catch (ValueError $e) {
echo $e->getMessage(), "\n";
}
var_dump($processor->maxTemplateVars === $oldValue);
?>
--EXPECT--
XSLTProcessor::$maxTemplateVars must be greater than or equal to 0
bool(true)
XSLTProcessor::$maxTemplateVars must be greater than or equal to 0
bool(true)
XSLTProcessor::$maxTemplateVars must be greater than or equal to 0
bool(true)
|