Skip to content

Commit 6db48b8

Browse files
authored
PHPC-2064: Use register_shutdown_function to disable caching of skipif results (#1366)
1 parent 04f504c commit 6db48b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/utils/skipif.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@
1515
*/
1616
function disable_skipif_caching()
1717
{
18+
static $skipifCachingDisabled;
19+
1820
if (PHP_VERSION_ID < 80100) {
1921
return;
2022
}
2123

22-
echo "nocache\n";
24+
if (! isset($skipifCachingDisabled)) {
25+
$skipifCachingDisabled = true;
26+
27+
register_shutdown_function(function() { echo "nocache\n"; });
28+
}
2329
}
2430

2531
/**

0 commit comments

Comments
 (0)