Commit 9ab800ec9b5 for php.net
commit 9ab800ec9b5959dfe3d4cde50f7a27a763d102f8
Author: Niels Dossche <7771979+ndossche@users.noreply.github.com>
Date: Sat Jan 10 10:52:28 2026 +0100
Mark Phar::buildFromIterator() base directory argument as a path
This is like buildFromDirectory() which does it right.
Closes GH-20892.
diff --git a/NEWS b/NEWS
index d2da15927ce..0899163d87b 100644
--- a/NEWS
+++ b/NEWS
@@ -54,6 +54,8 @@ PHP NEWS
ignored. (ndossche)
. Support overridden methods in SplFileInfo for getMTime() and getPathname()
when building a phar. (ndossche)
+ . Mark Phar::buildFromIterator() base directory argument as a path.
+ (ndossche)
- Reflection:
. Fixed bug GH-20217 (ReflectionClass::isIterable() incorrectly returns true
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index 338cdc705d0..5dd1dc4090c 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -1828,7 +1828,7 @@ PHP_METHOD(Phar, buildFromIterator)
zend_string *base = ZSTR_EMPTY_ALLOC();
struct _phar_t pass;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|S!", &obj, zend_ce_traversable, &base) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|P!", &obj, zend_ce_traversable, &base) == FAILURE) {
RETURN_THROWS();
}