[php-src] PHP-8.6: Backport: Fix GH-23899 destructor test expectation
| From: | Weilin Du | Date: | Mon, 28 Sep 2026 05:45:41 +0000 |
| Subject: | [php-src] PHP-8.6: Backport: Fix GH-23899 destructor test expectation | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-141610@lists.php.net to get a copy of this message | ||
Author: Weilin Du (LamentXU123)
Date: 2026-09-28T13:43:58+08:00
Commit: https://github.com/php/php-src/commit/ef8f6dde6d3c18ac11403e3542f3ea195e1e2abb
Raw diff: https://github.com/php/php-src/commit/ef8f6dde6d3c18ac11403e3542f3ea195e1e2abb.diff
Backport: Fix GH-23899 destructor test expectation
Backport from master to PHP-8.6.
Original commit: fe81f3d2b40a39b8cce73a2493759365bffe4c3b
The cancel callback returns a ThrowingDestructor object, which is not a
valid integer return value. Return-type validation reports a TypeError
during shutdown, so expecting only "Done" is incorrect.
Use EXPECTF to include the error while allowing the shutdown filename and
line number to vary.
Changed paths:
M ext/zip/tests/gh23899_destructor.phpt
Diff:
diff --git a/ext/zip/tests/gh23899_destructor.phpt b/ext/zip/tests/gh23899_destructor.phpt
index fad10717e592..04a33f150986 100644
--- a/ext/zip/tests/gh23899_destructor.phpt
+++ b/ext/zip/tests/gh23899_destructor.phpt
@@ -28,5 +28,10 @@ echo "Done\n";
<?php
@unlink(__DIR__ . '/gh23899_destructor.zip');
?>
---EXPECT--
+--EXPECTF--
Done
+
+Fatal error: Uncaught TypeError: Return value of callback provided to
ZipArchive::registerCancelCallback() must be of type int, ThrowingDestructor returned in %s:%d
+Stack trace:
+#0 {main}
+ thrown in %s on line %d