summaryrefslogtreecommitdiff
path: root/ext/xslt/tests/bug17931.phpt
blob: a85dd0674e68a4dbab8ec25ede91a9260d90cee4 (plain)
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
--TEST--
Pass object for xslt_error_handler, bug #17931
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
class xsl {

	function xsl() {
		$this->_parser = xslt_create();
	}
	
	function set_error() {
		xslt_set_error_handler($this->_parser, array($this, 'xslt_trap_error'));
		echo "OK";
	}
	
	function xslt_trap_error($parser, $errorno, $level, $fields) {
		return TRUE;
	}
	function clean() {
		xslt_free($this->_parser);
	}
}

$x = new xsl;
// work-around for possible '$this does not exist' bug in constructor
$x->set_error();
$x->clean();
?>
--EXPECT--
OK