bug30266.phpt 933 B

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