From 9f98dd80fde680a6d3a4ac7324f6ba55eac73c9e Mon Sep 17 00:00:00 2001 From: Jille Timmermans Date: Wed, 11 Apr 2012 15:28:17 +0200 Subject: [PATCH 1/2] Fix typo in test-description --- tests/weakref_006.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/weakref_006.phpt b/tests/weakref_006.phpt index 93cc972..5d95d11 100644 --- a/tests/weakref_006.phpt +++ b/tests/weakref_006.phpt @@ -1,5 +1,5 @@ --TEST-- -Weakref: Destroying the weakred within the std dtor of the object +Weakref: Destroying the weakref within the std dtor of the object --FILE-- Date: Wed, 11 Apr 2012 15:43:44 +0200 Subject: [PATCH 2/2] Add an extra test (which doesn't pass for me) --- tests/weakref_007.phpt | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/weakref_007.phpt diff --git a/tests/weakref_007.phpt b/tests/weakref_007.phpt new file mode 100644 index 0000000..27d19dd --- /dev/null +++ b/tests/weakref_007.phpt @@ -0,0 +1,46 @@ +--TEST-- +Weakref: Destroying the weakref and its object after a fatal error +--SKIPIF-- + +--FILE-- +ref = array($a); + } + + function __destruct() { + printf("Destroy B\n"); + var_dump($this->ref->valid()); + } + } + function doit() { + $a = new A(); + $b = new B($a); + crash(); + } + $pid = pcntl_fork(); + if($pid == 0) { + doit(); + exit(0); + } + pcntl_waitpid($pid, $status); + if(pcntl_wifsignaled($status)) { + echo "Killed: ". pcntl_wtermsig($status) ."\n"; + } elseif(pcntl_wifexited($status)) { + echo "Exit: ". pcntl_wexitstatus($status) ."\n"; + } else { + echo "Weird.\n"; + } +?> +--EXPECTF-- + +Fatal error: Call to undefined function crash() in %s on line %d +Exit: 255