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