xref: /PHP-7.0/ext/xml/tests/bug30266.phpt (revision 97200944)
1--TEST--
2Bug #30266 (Invalid opcode 137/1/8)
3--SKIPIF--
4<?php
5require_once("skipif.inc");
6?>
7--FILE--
8<?php
9/*
10
11Currently (Feb 10, 2005) CVS HEAD fails with the following message:
12
13Fatal error: Invalid opcode 137/1/8. in /home/hartmut/projects/php/dev/head/ext/xml/tests/bug30266.php on line 22
14
15*/
16class XML_Parser
17{
18    public $dummy = "a";
19
20    function parse($data)
21    {
22        $parser = xml_parser_create();
23
24        xml_set_object($parser, $this);
25
26        xml_set_element_handler($parser, 'startHandler', 'endHandler');
27
28        xml_parse($parser, $data, true);
29
30        xml_parser_free($parser);
31    }
32
33    function startHandler($XmlParser, $tag, $attr)
34    {
35            $this->dummy = "b";
36		    throw new Exception("ex");
37    }
38
39    function endHandler($XmlParser, $tag)
40    {
41    }
42}
43
44$p1 = new Xml_Parser();
45try {
46    $p1->parse('<tag1><tag2></tag2></tag1>');
47} catch (Exception $e) {
48	echo "OK\n";
49}
50?>
51--EXPECT--
52OK
53