bug31177-2.phpt 302 B

12345678910111213141516171819
  1. --TEST--
  2. Bug #31177 (memory corruption because of incorrect refcounting)
  3. --FILE--
  4. <?php
  5. class foo {
  6. function __construct($n=0) {
  7. if($n) throw new Exception("new");
  8. }
  9. }
  10. $x = new foo();
  11. try {
  12. $y=$x->__construct(1);
  13. } catch (Exception $e) {
  14. var_dump($x);
  15. }
  16. ?>
  17. --EXPECT--
  18. object(foo)#1 (0) {
  19. }