Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/build-cross-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ jobs:
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--with-pdo-firebird \
--enable-address-sanitizer \
--enable-async

- name: Build PHP
Expand Down Expand Up @@ -165,7 +166,7 @@ jobs:
--no-progress \
--offline \
--show-diff \
--show-slow 2000 \
--show-slow 4000 \
--set-timeout 120 \
--repeat 2

Expand Down Expand Up @@ -309,6 +310,7 @@ jobs:
--enable-inifile \
--with-config-file-path=/usr/local/etc \
--with-config-file-scan-dir=/usr/local/etc/php.d \
--enable-address-sanitizer \
--enable-async

- name: Build PHP (macOS)
Expand Down Expand Up @@ -342,7 +344,7 @@ jobs:
--no-progress ^
--offline ^
--show-diff ^
--show-slow 2000 ^
--show-slow 4000 ^
--set-timeout 120 ^
--repeat 2
shell: cmd
Expand All @@ -364,6 +366,6 @@ jobs:
--no-progress \
--offline \
--show-diff \
--show-slow 2000 \
--show-slow 4000 \
--set-timeout 120 \
--repeat 2
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ jobs:
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--with-pdo-firebird \
--enable-address-sanitizer \
--enable-async

- name: Build PHP
Expand Down Expand Up @@ -164,6 +165,6 @@ jobs:
--no-progress \
--offline \
--show-diff \
--show-slow 2000 \
--show-slow 4000 \
--set-timeout 120 \
--repeat 2
52 changes: 52 additions & 0 deletions tests/gc/013-gc-fiber-destructors.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
--TEST--
Fibers in destructors 006: multiple GC runs
--FILE--
<?php

register_shutdown_function(function () {
printf("Shutdown\n");
});

class Cycle {
public static $counter = 0;
public $self;
public function __construct() {
$this->self = $this;
}
public function __destruct() {
$id = self::$counter++;
printf("%d: Start destruct\n", $id);
if ($id === 0) {
global $f2;
$f2 = Fiber::getCurrent();
Fiber::suspend(new stdClass);
}
printf("%d: End destruct\n", $id);
}
}

$f = new Fiber(function () {
new Cycle();
new Cycle();
gc_collect_cycles();
});

$f->start();

new Cycle();
new Cycle();
gc_collect_cycles();

$f2->resume();

?>
--EXPECT--
0: Start destruct
1: Start destruct
1: End destruct
2: Start destruct
2: End destruct
3: Start destruct
3: End destruct
0: End destruct
Shutdown