[php7] Use destructor action if present
If there's a destructor, use its action instead of free(ptr) (for C)/delete ptr (for C++). Fixes #2108
This commit is contained in:
parent
51f586bc4c
commit
c25df74807
2 changed files with 43 additions and 9 deletions
17
Examples/test-suite/php/newobject2_runme.php
Normal file
17
Examples/test-suite/php/newobject2_runme.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
require "tests.php";
|
||||
|
||||
check::equal(fooCount(), 0, "no Foo objects expected");
|
||||
$foo = makeFoo();
|
||||
check::equal(get_class($foo), "Foo", "static failed");
|
||||
check::equal(fooCount(), 1, "1 Foo object expected");
|
||||
$bar = makeFoo();
|
||||
check::equal(get_class($bar), "Foo", "regular failed");
|
||||
check::equal(fooCount(), 2, "2 Foo objects expected");
|
||||
$foo = null;
|
||||
check::equal(fooCount(), 1, "1 Foo object expected");
|
||||
$bar = null;
|
||||
check::equal(fooCount(), 0, "no Foo objects expected");
|
||||
|
||||
check::done();
|
||||
Loading…
Add table
Add a link
Reference in a new issue