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