1--TEST--
2XSLTProcessor::$maxTemplateDepth errors
3--EXTENSIONS--
4xsl
5--INI--
6error_reporting=E_ALL & ~E_DEPRECATED
7--FILE--
8<?php
9
10$processor = new XSLTProcessor;
11$oldValue = $processor->maxTemplateDepth;
12
13try {
14    $processor->maxTemplateDepth = -1;
15} catch (ValueError $e) {
16    echo $e->getMessage(), "\n";
17}
18
19var_dump($processor->maxTemplateDepth === $oldValue);
20
21try {
22    $processor->maxTemplateDepth = -32.1;
23} catch (ValueError $e) {
24    echo $e->getMessage(), "\n";
25}
26
27var_dump($processor->maxTemplateDepth === $oldValue);
28
29try {
30    $processor->maxTemplateDepth = "-1";
31} catch (ValueError $e) {
32    echo $e->getMessage(), "\n";
33}
34
35var_dump($processor->maxTemplateDepth === $oldValue);
36
37?>
38--EXPECT--
39XSLTProcessor::$maxTemplateDepth must be greater than or equal to 0
40bool(true)
41XSLTProcessor::$maxTemplateDepth must be greater than or equal to 0
42bool(true)
43XSLTProcessor::$maxTemplateDepth must be greater than or equal to 0
44bool(true)
45