From 97f9c5753c966c4716f12d7fb33b57d2b667ed4e Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 16 Mar 2025 00:42:45 +0000 Subject: [PATCH 1/3] ext/standard: Add Directory test with messed up internal state --- ...adonly_handle_by_pass_via_ArrayObject.phpt | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt diff --git a/ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt b/ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt new file mode 100644 index 0000000000000..cc57fc6933aa4 --- /dev/null +++ b/ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt @@ -0,0 +1,34 @@ +--TEST-- +Changing Directory::$handle property +--FILE-- +getMessage(), PHP_EOL; +} +var_dump($d->handle); + +try { + $s = $d->read(); + var_dump($s); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; +} + +try { + unset($ao['handle']); + var_dump($d->handle); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), PHP_EOL; +} + +?> +--EXPECT-- +resource(3) of type (stream) +TypeError: Directory::read(): Argument #1 must be a valid Directory resource +Error: Typed property Directory::$handle must not be accessed before initialization From 3fa93e7a136a3691665490992d5ebc82424f2ac2 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 16 Mar 2025 01:58:48 +0000 Subject: [PATCH 2/3] ext/standard/dir.c: Refactor implementation of Directory and dir functions --- ext/standard/dir.c | 224 ++++++++++++------ ext/standard/dir.stub.php | 9 - ext/standard/dir_arginfo.h | 14 +- .../dir/closedir_variation2-win32-mb.phpt | 2 +- .../tests/dir/closedir_variation2.phpt | 2 +- .../tests/dir/dir_basic-win32-mb.phpt | 2 +- ext/standard/tests/dir/dir_basic.phpt | 2 +- .../dir/rewinddir_variation2-win32-mb.phpt | 2 +- .../tests/dir/rewinddir_variation2.phpt | 2 +- ...adonly_handle_by_pass_via_ArrayObject.phpt | 2 +- ...flection_create_instance_no_construct.phpt | 2 +- 11 files changed, 160 insertions(+), 103 deletions(-) diff --git a/ext/standard/dir.c b/ext/standard/dir.c index a2a50eab7f51d..845fcd03eeadc 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -59,39 +59,6 @@ static zend_function *dir_class_get_constructor(zend_object *object) return NULL; } -#define FETCH_DIRP() \ - myself = getThis(); \ - if (!myself) { \ - ZEND_PARSE_PARAMETERS_START(0, 1) \ - Z_PARAM_OPTIONAL \ - Z_PARAM_RESOURCE_OR_NULL(id) \ - ZEND_PARSE_PARAMETERS_END(); \ - if (id) { \ - if ((dirp = (php_stream *)zend_fetch_resource(Z_RES_P(id), "Directory", php_file_le_stream())) == NULL) { \ - RETURN_THROWS(); \ - } \ - } else { \ - if (!DIRG(default_dir)) { \ - zend_type_error("No resource supplied"); \ - RETURN_THROWS(); \ - } \ - if ((dirp = (php_stream *)zend_fetch_resource(DIRG(default_dir), "Directory", php_file_le_stream())) == NULL) { \ - RETURN_THROWS(); \ - } \ - } \ - } else { \ - ZEND_PARSE_PARAMETERS_NONE(); \ - zval *handle_zv = Z_DIRECTORY_HANDLE_P(myself); \ - if (Z_TYPE_P(handle_zv) != IS_RESOURCE) { \ - zend_throw_error(NULL, "Unable to find my handle property"); \ - RETURN_THROWS(); \ - } \ - if ((dirp = (php_stream *)zend_fetch_resource_ex(handle_zv, "Directory", php_file_le_stream())) == NULL) { \ - RETURN_THROWS(); \ - } \ - } - - static void php_set_default_dir(zend_resource *res) { if (DIRG(default_dir)) { @@ -189,29 +156,166 @@ PHP_FUNCTION(dir) } /* }}} */ + +static php_stream* php_dir_get_directory_stream_from_user_arg(zval *arg) +{ + zend_resource *res; + if (arg == NULL) { + if (UNEXPECTED(DIRG(default_dir) == NULL)) { + zend_type_error("No resource supplied"); + return NULL; + } + res = DIRG(default_dir); + } else { + ZEND_ASSERT(Z_TYPE_P(arg) == IS_RESOURCE); + res = Z_RES_P(arg); + } + + if (UNEXPECTED(res->type != php_file_le_stream())) { + zend_argument_type_error(1, "must be a valid Directory resource"); + return NULL; + } + php_stream *dir_stream = (php_stream*) res->ptr; + if (UNEXPECTED((dir_stream->flags & PHP_STREAM_FLAG_IS_DIR)) == 0) { + zend_argument_type_error(1, "must be a valid Directory resource"); + return NULL; + } + return dir_stream; +} + +static php_stream* php_dir_get_directory_stream_from_this(zval *this_z) +{ + zval *handle_zv = Z_DIRECTORY_HANDLE_P(this_z); + if (UNEXPECTED(Z_TYPE_P(handle_zv) != IS_RESOURCE)) { + zend_throw_error(NULL, "Internal directory stream has been altered"); + return NULL; + } + zend_resource *res = Z_RES_P(handle_zv); + /* Assume the close() method was called + * (instead of the hacky case where a different resource would have been set via the ArrayObject "hack") */ + if (UNEXPECTED(res->type != php_file_le_stream())) { + /* TypeError is used for BC, TODO: Use base Error in PHP 9 */ + zend_type_error("Directory::%s(): cannot use Directory resource after it has been closed", get_active_function_name()); + return NULL; + } + php_stream *dir_stream = (php_stream*) res->ptr; + if (UNEXPECTED((dir_stream->flags & PHP_STREAM_FLAG_IS_DIR)) == 0) { + zend_throw_error(NULL, "Internal directory stream has been altered"); + return NULL; + } + return dir_stream; +} + /* {{{ Close directory connection identified by the dir_handle */ PHP_FUNCTION(closedir) { - zval *id = NULL, *myself; - php_stream *dirp; - zend_resource *res; + zval *id = NULL; - FETCH_DIRP(); + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_RESOURCE_OR_NULL(id) + ZEND_PARSE_PARAMETERS_END(); - if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { - zend_argument_type_error(1, "must be a valid Directory resource"); + php_stream *dirp = php_dir_get_directory_stream_from_user_arg(id); + if (UNEXPECTED(dirp == NULL)) { RETURN_THROWS(); } + zend_resource *res = dirp->res; + zend_list_close(res); - res = dirp->res; - zend_list_close(dirp->res); + if (res == DIRG(default_dir)) { + php_set_default_dir(NULL); + } +} +/* }}} */ + +PHP_METHOD(Directory, close) +{ + ZEND_PARSE_PARAMETERS_NONE(); + + php_stream *dirp = php_dir_get_directory_stream_from_this(ZEND_THIS); + if (UNEXPECTED(dirp == NULL)) { + RETURN_THROWS(); + } + + zend_resource *res = dirp->res; + zend_list_close(res); if (res == DIRG(default_dir)) { php_set_default_dir(NULL); } } + +/* {{{ Rewind dir_handle back to the start */ +PHP_FUNCTION(rewinddir) +{ + zval *id = NULL; + + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_RESOURCE_OR_NULL(id) + ZEND_PARSE_PARAMETERS_END(); + + php_stream *dirp = php_dir_get_directory_stream_from_user_arg(id); + if (UNEXPECTED(dirp == NULL)) { + RETURN_THROWS(); + } + + php_stream_rewinddir(dirp); +} /* }}} */ +PHP_METHOD(Directory, rewind) +{ + ZEND_PARSE_PARAMETERS_NONE(); + + php_stream *dirp = php_dir_get_directory_stream_from_this(ZEND_THIS); + if (UNEXPECTED(dirp == NULL)) { + RETURN_THROWS(); + } + + php_stream_rewinddir(dirp); +} + +/* {{{ Read directory entry from dir_handle */ +PHP_FUNCTION(readdir) +{ + zval *id = NULL; + + ZEND_PARSE_PARAMETERS_START(0, 1) + Z_PARAM_OPTIONAL + Z_PARAM_RESOURCE_OR_NULL(id) + ZEND_PARSE_PARAMETERS_END(); + + php_stream *dirp = php_dir_get_directory_stream_from_user_arg(id); + if (UNEXPECTED(dirp == NULL)) { + RETURN_THROWS(); + } + + php_stream_dirent entry; + if (php_stream_readdir(dirp, &entry)) { + RETURN_STRING(entry.d_name); + } + RETURN_FALSE; +} +/* }}} */ + +PHP_METHOD(Directory, read) +{ + ZEND_PARSE_PARAMETERS_NONE(); + + php_stream *dirp = php_dir_get_directory_stream_from_this(ZEND_THIS); + if (UNEXPECTED(dirp == NULL)) { + RETURN_THROWS(); + } + + php_stream_dirent entry; + if (php_stream_readdir(dirp, &entry)) { + RETURN_STRING(entry.d_name); + } + RETURN_FALSE; +} + #if defined(HAVE_CHROOT) && !defined(ZTS) && defined(ENABLE_CHROOT_FUNC) /* {{{ Change root directory */ PHP_FUNCTION(chroot) @@ -300,44 +404,6 @@ PHP_FUNCTION(getcwd) } /* }}} */ -/* {{{ Rewind dir_handle back to the start */ -PHP_FUNCTION(rewinddir) -{ - zval *id = NULL, *myself; - php_stream *dirp; - - FETCH_DIRP(); - - if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { - zend_argument_type_error(1, "must be a valid Directory resource"); - RETURN_THROWS(); - } - - php_stream_rewinddir(dirp); -} -/* }}} */ - -/* {{{ Read directory entry from dir_handle */ -PHP_FUNCTION(readdir) -{ - zval *id = NULL, *myself; - php_stream *dirp; - php_stream_dirent entry; - - FETCH_DIRP(); - - if (!(dirp->flags & PHP_STREAM_FLAG_IS_DIR)) { - zend_argument_type_error(1, "must be a valid Directory resource"); - RETURN_THROWS(); - } - - if (php_stream_readdir(dirp, &entry)) { - RETURN_STRINGL(entry.d_name, strlen(entry.d_name)); - } - RETURN_FALSE; -} -/* }}} */ - #ifdef HAVE_GLOB /* {{{ Find pathnames matching a pattern */ PHP_FUNCTION(glob) diff --git a/ext/standard/dir.stub.php b/ext/standard/dir.stub.php index 457a965352516..afca1fcacc421 100644 --- a/ext/standard/dir.stub.php +++ b/ext/standard/dir.stub.php @@ -98,18 +98,9 @@ final class Directory /** @var resource */ public readonly mixed $handle; - /** - * @implementation-alias closedir - */ public function close(): void {} - /** - * @implementation-alias rewinddir - */ public function rewind(): void {} - /** - * @implementation-alias readdir - */ public function read(): string|false {} } diff --git a/ext/standard/dir_arginfo.h b/ext/standard/dir_arginfo.h index 9b293f3cd753f..f73b0e5d86ad1 100644 --- a/ext/standard/dir_arginfo.h +++ b/ext/standard/dir_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 069117bab1b9502faf516307aa7e80308f7b7f13 */ + * Stub hash: 543d0d12062ed88dab7a3ac4354499682c5c7166 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Directory_close, 0, 0, IS_VOID, 0) ZEND_END_ARG_INFO() @@ -9,14 +9,14 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Directory_read, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_END_ARG_INFO() -ZEND_FUNCTION(closedir); -ZEND_FUNCTION(rewinddir); -ZEND_FUNCTION(readdir); +ZEND_METHOD(Directory, close); +ZEND_METHOD(Directory, rewind); +ZEND_METHOD(Directory, read); static const zend_function_entry class_Directory_methods[] = { - ZEND_RAW_FENTRY("close", zif_closedir, arginfo_class_Directory_close, ZEND_ACC_PUBLIC, NULL, NULL) - ZEND_RAW_FENTRY("rewind", zif_rewinddir, arginfo_class_Directory_rewind, ZEND_ACC_PUBLIC, NULL, NULL) - ZEND_RAW_FENTRY("read", zif_readdir, arginfo_class_Directory_read, ZEND_ACC_PUBLIC, NULL, NULL) + ZEND_ME(Directory, close, arginfo_class_Directory_close, ZEND_ACC_PUBLIC) + ZEND_ME(Directory, rewind, arginfo_class_Directory_rewind, ZEND_ACC_PUBLIC) + ZEND_ME(Directory, read, arginfo_class_Directory_read, ZEND_ACC_PUBLIC) ZEND_FE_END }; diff --git a/ext/standard/tests/dir/closedir_variation2-win32-mb.phpt b/ext/standard/tests/dir/closedir_variation2-win32-mb.phpt index 9999cb8b10e51..08842ae7f7b10 100644 --- a/ext/standard/tests/dir/closedir_variation2-win32-mb.phpt +++ b/ext/standard/tests/dir/closedir_variation2-win32-mb.phpt @@ -47,5 +47,5 @@ NULL Directory Handle: resource(%d) of type (Unknown) -- Close directory handle second time: -- -closedir(): %s is not a valid Directory resource +closedir(): Argument #1 ($dir_handle) must be a valid Directory resource Directory Handle: resource(%d) of type (Unknown) diff --git a/ext/standard/tests/dir/closedir_variation2.phpt b/ext/standard/tests/dir/closedir_variation2.phpt index e4b782c255ce8..e8518c3d3efcf 100644 --- a/ext/standard/tests/dir/closedir_variation2.phpt +++ b/ext/standard/tests/dir/closedir_variation2.phpt @@ -41,5 +41,5 @@ NULL Directory Handle: resource(%d) of type (Unknown) -- Close directory handle second time: -- -closedir(): supplied resource is not a valid Directory resource +closedir(): Argument #1 ($dir_handle) must be a valid Directory resource Directory Handle: resource(%d) of type (Unknown) diff --git a/ext/standard/tests/dir/dir_basic-win32-mb.phpt b/ext/standard/tests/dir/dir_basic-win32-mb.phpt index 74e2cda6f070b..040596d40d6e7 100644 --- a/ext/standard/tests/dir/dir_basic-win32-mb.phpt +++ b/ext/standard/tests/dir/dir_basic-win32-mb.phpt @@ -85,5 +85,5 @@ object(Directory)#%d (2) { } Test read after closing the dir: -Directory::read(): %s is not a valid Directory resource +Directory::read(): cannot use Directory resource after it has been closed Done diff --git a/ext/standard/tests/dir/dir_basic.phpt b/ext/standard/tests/dir/dir_basic.phpt index d474122ba243b..17a2b42bcdaea 100644 --- a/ext/standard/tests/dir/dir_basic.phpt +++ b/ext/standard/tests/dir/dir_basic.phpt @@ -79,5 +79,5 @@ object(Directory)#%d (2) { } Test read after closing the dir: -Directory::read(): supplied resource is not a valid Directory resource +Directory::read(): cannot use Directory resource after it has been closed Done diff --git a/ext/standard/tests/dir/rewinddir_variation2-win32-mb.phpt b/ext/standard/tests/dir/rewinddir_variation2-win32-mb.phpt index ab639c7f24f3c..7cb9f2616c5c9 100644 --- a/ext/standard/tests/dir/rewinddir_variation2-win32-mb.phpt +++ b/ext/standard/tests/dir/rewinddir_variation2-win32-mb.phpt @@ -42,4 +42,4 @@ resource(%d) of type (stream) string(%d) "%s" -- Call to rewinddir() -- -rewinddir(): %s is not a valid Directory resource +rewinddir(): Argument #1 ($dir_handle) must be a valid Directory resource diff --git a/ext/standard/tests/dir/rewinddir_variation2.phpt b/ext/standard/tests/dir/rewinddir_variation2.phpt index 654c68cecbe01..16d66da7f8287 100644 --- a/ext/standard/tests/dir/rewinddir_variation2.phpt +++ b/ext/standard/tests/dir/rewinddir_variation2.phpt @@ -36,4 +36,4 @@ resource(%d) of type (stream) string(%d) "%s" -- Call to rewinddir() -- -rewinddir(): supplied resource is not a valid Directory resource +rewinddir(): Argument #1 ($dir_handle) must be a valid Directory resource diff --git a/ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt b/ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt index cc57fc6933aa4..91416f2c71202 100644 --- a/ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt +++ b/ext/standard/tests/directory/DirectoryClass_readonly_handle_by_pass_via_ArrayObject.phpt @@ -30,5 +30,5 @@ try { ?> --EXPECT-- resource(3) of type (stream) -TypeError: Directory::read(): Argument #1 must be a valid Directory resource +Error: Internal directory stream has been altered Error: Typed property Directory::$handle must not be accessed before initialization diff --git a/ext/standard/tests/directory/DirectoryClass_reflection_create_instance_no_construct.phpt b/ext/standard/tests/directory/DirectoryClass_reflection_create_instance_no_construct.phpt index 35b07591635fd..95999581f31c9 100644 --- a/ext/standard/tests/directory/DirectoryClass_reflection_create_instance_no_construct.phpt +++ b/ext/standard/tests/directory/DirectoryClass_reflection_create_instance_no_construct.phpt @@ -27,4 +27,4 @@ object(Directory)#2 (0) { ["handle"]=> uninitialized(mixed) } -Error: Unable to find my handle property +Error: Internal directory stream has been altered From 33c2c411f3ab52f740af33c9175b17a54ac62612 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Mon, 17 Mar 2025 14:23:41 +0000 Subject: [PATCH 3/3] ext/standard/dir.c: Use new PHP_Z_PARAM_STREAM_OR_NULL() ZPP specifier --- ext/standard/dir.c | 35 ++++++++----------- .../dir/closedir_variation2-win32-mb.phpt | 2 +- .../tests/dir/closedir_variation2.phpt | 2 +- .../dir/rewinddir_variation2-win32-mb.phpt | 2 +- .../tests/dir/rewinddir_variation2.phpt | 2 +- 5 files changed, 18 insertions(+), 25 deletions(-) diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 845fcd03eeadc..b468681ac364a 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -157,25 +157,18 @@ PHP_FUNCTION(dir) /* }}} */ -static php_stream* php_dir_get_directory_stream_from_user_arg(zval *arg) +static php_stream* php_dir_get_directory_stream_from_user_arg(php_stream *dir_stream) { - zend_resource *res; - if (arg == NULL) { + if (dir_stream == NULL) { if (UNEXPECTED(DIRG(default_dir) == NULL)) { zend_type_error("No resource supplied"); return NULL; } - res = DIRG(default_dir); - } else { - ZEND_ASSERT(Z_TYPE_P(arg) == IS_RESOURCE); - res = Z_RES_P(arg); + zend_resource *res = DIRG(default_dir); + ZEND_ASSERT(res->type == php_file_le_stream()); + dir_stream = (php_stream*) res->ptr; } - if (UNEXPECTED(res->type != php_file_le_stream())) { - zend_argument_type_error(1, "must be a valid Directory resource"); - return NULL; - } - php_stream *dir_stream = (php_stream*) res->ptr; if (UNEXPECTED((dir_stream->flags & PHP_STREAM_FLAG_IS_DIR)) == 0) { zend_argument_type_error(1, "must be a valid Directory resource"); return NULL; @@ -209,14 +202,14 @@ static php_stream* php_dir_get_directory_stream_from_this(zval *this_z) /* {{{ Close directory connection identified by the dir_handle */ PHP_FUNCTION(closedir) { - zval *id = NULL; + php_stream *dirp = NULL; ZEND_PARSE_PARAMETERS_START(0, 1) Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE_OR_NULL(id) + PHP_Z_PARAM_STREAM_OR_NULL(dirp) ZEND_PARSE_PARAMETERS_END(); - php_stream *dirp = php_dir_get_directory_stream_from_user_arg(id); + dirp = php_dir_get_directory_stream_from_user_arg(dirp); if (UNEXPECTED(dirp == NULL)) { RETURN_THROWS(); } @@ -249,14 +242,14 @@ PHP_METHOD(Directory, close) /* {{{ Rewind dir_handle back to the start */ PHP_FUNCTION(rewinddir) { - zval *id = NULL; + php_stream *dirp = NULL; ZEND_PARSE_PARAMETERS_START(0, 1) Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE_OR_NULL(id) + PHP_Z_PARAM_STREAM_OR_NULL(dirp) ZEND_PARSE_PARAMETERS_END(); - php_stream *dirp = php_dir_get_directory_stream_from_user_arg(id); + dirp = php_dir_get_directory_stream_from_user_arg(dirp); if (UNEXPECTED(dirp == NULL)) { RETURN_THROWS(); } @@ -280,14 +273,14 @@ PHP_METHOD(Directory, rewind) /* {{{ Read directory entry from dir_handle */ PHP_FUNCTION(readdir) { - zval *id = NULL; + php_stream *dirp = NULL; ZEND_PARSE_PARAMETERS_START(0, 1) Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE_OR_NULL(id) + PHP_Z_PARAM_STREAM_OR_NULL(dirp) ZEND_PARSE_PARAMETERS_END(); - php_stream *dirp = php_dir_get_directory_stream_from_user_arg(id); + dirp = php_dir_get_directory_stream_from_user_arg(dirp); if (UNEXPECTED(dirp == NULL)) { RETURN_THROWS(); } diff --git a/ext/standard/tests/dir/closedir_variation2-win32-mb.phpt b/ext/standard/tests/dir/closedir_variation2-win32-mb.phpt index 08842ae7f7b10..1ada5b7fb36c5 100644 --- a/ext/standard/tests/dir/closedir_variation2-win32-mb.phpt +++ b/ext/standard/tests/dir/closedir_variation2-win32-mb.phpt @@ -47,5 +47,5 @@ NULL Directory Handle: resource(%d) of type (Unknown) -- Close directory handle second time: -- -closedir(): Argument #1 ($dir_handle) must be a valid Directory resource +closedir(): Argument #1 ($dir_handle) must be an open stream resource Directory Handle: resource(%d) of type (Unknown) diff --git a/ext/standard/tests/dir/closedir_variation2.phpt b/ext/standard/tests/dir/closedir_variation2.phpt index e8518c3d3efcf..7898c9ae0ff13 100644 --- a/ext/standard/tests/dir/closedir_variation2.phpt +++ b/ext/standard/tests/dir/closedir_variation2.phpt @@ -41,5 +41,5 @@ NULL Directory Handle: resource(%d) of type (Unknown) -- Close directory handle second time: -- -closedir(): Argument #1 ($dir_handle) must be a valid Directory resource +closedir(): Argument #1 ($dir_handle) must be an open stream resource Directory Handle: resource(%d) of type (Unknown) diff --git a/ext/standard/tests/dir/rewinddir_variation2-win32-mb.phpt b/ext/standard/tests/dir/rewinddir_variation2-win32-mb.phpt index 7cb9f2616c5c9..4bd69b61ff7d6 100644 --- a/ext/standard/tests/dir/rewinddir_variation2-win32-mb.phpt +++ b/ext/standard/tests/dir/rewinddir_variation2-win32-mb.phpt @@ -42,4 +42,4 @@ resource(%d) of type (stream) string(%d) "%s" -- Call to rewinddir() -- -rewinddir(): Argument #1 ($dir_handle) must be a valid Directory resource +rewinddir(): Argument #1 ($dir_handle) must be an open stream resource diff --git a/ext/standard/tests/dir/rewinddir_variation2.phpt b/ext/standard/tests/dir/rewinddir_variation2.phpt index 16d66da7f8287..7ce3c522352d7 100644 --- a/ext/standard/tests/dir/rewinddir_variation2.phpt +++ b/ext/standard/tests/dir/rewinddir_variation2.phpt @@ -36,4 +36,4 @@ resource(%d) of type (stream) string(%d) "%s" -- Call to rewinddir() -- -rewinddir(): Argument #1 ($dir_handle) must be a valid Directory resource +rewinddir(): Argument #1 ($dir_handle) must be an open stream resource