PATH:
opt
/
alt
/
tests
/
alt-php72-pecl-weakref_0.3.3-1.el8
/
tests
--TEST-- Weakref: Destroying the weakref and its object after a fatal error --SKIPIF-- <?php if(!function_exists('pcntl_fork')) echo "skip can't test for returnvalue"; ?> --FILE-- <?php class A { function __destruct() { printf("Destroy A\n"); } } class B { public $ref; function __construct($a) { $this->ref = new WeakRef($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-- Destroy A Destroy B bool(false) Fatal error: Uncaught Error: Call to undefined function crash() in %s:%d Stack trace: #0 %s(%d): doit() #1 {main} thrown in %s on line %d Exit: 255
[-] weakmap_004.phpt
[edit]
[-] weakref_011.phpt
[edit]
[-] weakref_002.phpt
[edit]
[-] weakref_012.phpt
[edit]
[-] weakref_007.phpt
[edit]
[-] weakref_008.phpt
[edit]
[-] weakref_004.phpt
[edit]
[-] weakref_009.phpt
[edit]
[-] weakmap_005.phpt
[edit]
[-] weakmap_001.phpt
[edit]
[-] weakref_010.phpt
[edit]
[-] weakref_013.phpt
[edit]
[-] weakref_001.phpt
[edit]
[-] weakref_003.phpt
[edit]
[-] weakref_005.phpt
[edit]
[-] weakmap_002.phpt
[edit]
[-] weakmap_003.phpt
[edit]
[-] weakref_006.phpt
[edit]
[+]
..
[-] weakref_014.phpt
[edit]