bug30266.phpt 913 B

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