From 04f3d282f8d090ed1c1dd9fb42144cea2b110beb Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 16 Jul 2026 08:05:16 -0400 Subject: [PATCH 01/15] ext/standard: reject a dechunk chunk size that overflows size_t php_dechunk() accumulated the hex chunk size with chunk_size * 16 + digit and never checked the multiply, so a size of 2^64 wrapped to 0. A zero size reads as the terminating chunk, so the filter stopped there and dropped the body it had been handed. Error out instead, as the other malformed-size cases already do. Closes GH-22786 --- ext/standard/filters.c | 13 +++++-- .../tests/filters/dechunk_size_overflow.phpt | 38 +++++++++++++++++++ 2 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 ext/standard/tests/filters/dechunk_size_overflow.phpt diff --git a/ext/standard/filters.c b/ext/standard/filters.c index a7c0a035a239..0c08600648cd 100644 --- a/ext/standard/filters.c +++ b/ext/standard/filters.c @@ -1715,12 +1715,14 @@ static size_t php_dechunk(char *buf, size_t len, php_chunked_filter_data *data) data->chunk_size = 0; case CHUNK_SIZE: while (p < end) { + size_t digit; + if (*p >= '0' && *p <= '9') { - data->chunk_size = (data->chunk_size * 16) + (*p - '0'); + digit = *p - '0'; } else if (*p >= 'A' && *p <= 'F') { - data->chunk_size = (data->chunk_size * 16) + (*p - 'A' + 10); + digit = *p - 'A' + 10; } else if (*p >= 'a' && *p <= 'f') { - data->chunk_size = (data->chunk_size * 16) + (*p - 'a' + 10); + digit = *p - 'a' + 10; } else if (data->state == CHUNK_SIZE_START) { data->state = CHUNK_ERROR; break; @@ -1728,6 +1730,11 @@ static size_t php_dechunk(char *buf, size_t len, php_chunked_filter_data *data) data->state = CHUNK_SIZE_EXT; break; } + if (data->chunk_size > (SIZE_MAX / 16)) { + data->state = CHUNK_ERROR; + break; + } + data->chunk_size = (data->chunk_size * 16) + digit; data->state = CHUNK_SIZE; p++; } diff --git a/ext/standard/tests/filters/dechunk_size_overflow.phpt b/ext/standard/tests/filters/dechunk_size_overflow.phpt new file mode 100644 index 000000000000..ac42733e16e0 --- /dev/null +++ b/ext/standard/tests/filters/dechunk_size_overflow.phpt @@ -0,0 +1,38 @@ +--TEST-- +dechunk filter must reject a chunk size that overflows size_t +--SKIPIF-- + +--INI-- +allow_url_fopen=1 +--FILE-- + +--EXPECTF-- +string(%d) "%s +BODYDATA +0 +" +string(%d) "%s +BODYDATA +0 +" +string(5) "hello" From 34c686a5b4ef10fd2451deb52422b410d4c7d619 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 19 Jul 2026 16:15:01 +0100 Subject: [PATCH 02/15] stream: remove path parameter in stream error functions (#22792) Instead rely on the mechanism gated by the error_include_args INI to display them. This actually aligns the behaviour of what was accepted in https://wiki.php.net/rfc/display_error_function_args. --- ...debug_backtrace_with_include_and_this.phpt | 2 +- Zend/tests/bug30998.phpt | 4 ++-- Zend/tests/bug60909_1.phpt | 4 ++-- Zend/tests/gh11735_2.phpt | 2 +- Zend/tests/include_stat_is_quiet.phpt | 2 +- Zend/tests/oss_fuzz_64209.phpt | 2 +- .../require_once_warning_to_exception.phpt | 2 +- ext/bz2/tests/001.phpt | 2 +- ext/bz2/tests/002.phpt | 4 ++-- ext/dba/tests/dba_cdb_creation_matrix.phpt | 16 ++++++------- .../tests/dba_flatfile_creation_matrix.phpt | 16 ++++++------- .../tests/dba_inifile_creation_matrix.phpt | 16 ++++++------- ext/dba/tests/dba_tcadb_creation_matrix.phpt | 8 +++---- ext/dba/tests/gh18247.phpt | 2 +- ...nt_fromFile_local_file_does_not_exist.phpt | 2 +- ext/exif/tests/exif_imagetype_error.phpt | 2 +- ext/fileinfo/tests/bug68996.phpt | 4 ++-- ext/fileinfo/tests/finfo_file_001.phpt | 2 +- ext/fileinfo/tests/finfo_open_001.phpt | 18 +++++++------- ext/fileinfo/tests/finfo_open_error.phpt | 4 ++-- ext/fileinfo/tests/mime_content_type_001.phpt | 2 +- ext/gd/tests/001-mb.phpt | 2 +- ext/gd/tests/001.phpt | 2 +- ext/gd/tests/imageloadfont_error2.phpt | 2 +- ext/hash/tests/hash_file_error.phpt | 2 +- ext/libxml/tests/bug61367-write.phpt | 2 +- ..._pam_sha256_public_key_option_invalid.phpt | 2 +- ext/openssl/tests/bug65538_002.phpt | 2 +- ext/phar/tests/013.phpt | 2 +- ext/phar/tests/014.phpt | 2 +- ext/phar/tests/016.phpt | 6 ++--- ext/phar/tests/016b.phpt | 2 +- ext/phar/tests/017.phpt | 2 +- ext/phar/tests/027.phpt | 4 ++-- ext/phar/tests/bug69720.phpt | 2 +- ext/phar/tests/bug77432.phpt | 2 +- ext/phar/tests/bug81726.phpt | 2 +- .../tests/cache_list/frontcontroller22.phpt | 2 +- ext/phar/tests/create_new_phar_b.phpt | 4 ++-- ext/phar/tests/create_path_error.phpt | 18 +++++++------- ext/phar/tests/delete.phpt | 2 +- ext/phar/tests/delete_in_phar.phpt | 2 +- ext/phar/tests/delete_in_phar_confirm.phpt | 2 +- ext/phar/tests/fgc_edgecases.phpt | 2 +- ext/phar/tests/fopen.phpt | 2 +- ext/phar/tests/fopen_edgecases.phpt | 12 +++++----- ext/phar/tests/fopen_edgecases2.phpt | 2 +- ext/phar/tests/frontcontroller22.phpt | 2 +- ext/phar/tests/include_path.phpt | 2 +- ext/phar/tests/mounteddir.phpt | 2 +- ext/phar/tests/open_for_write_existing_b.phpt | 2 +- ext/phar/tests/open_for_write_existing_c.phpt | 2 +- ext/phar/tests/open_for_write_newfile_b.phpt | 4 ++-- ext/phar/tests/open_for_write_newfile_c.phpt | 4 ++-- ext/phar/tests/opendir.phpt | 4 ++-- ext/phar/tests/opendir_edgecases.phpt | 2 +- .../tests/phar_buildfromdirectory2-win.phpt | 2 +- ext/phar/tests/phar_buildfromdirectory2.phpt | 2 +- ext/phar/tests/phar_gobyebye-win32.phpt | 8 +++---- ext/phar/tests/phar_gobyebye.phpt | 8 +++---- ext/phar/tests/readfile_edgecases.phpt | 2 +- ext/phar/tests/rename.phpt | 2 +- ext/phar/tests/rename_dir.phpt | 2 +- ext/phar/tests/tar/create_new_phar_b.phpt | 4 ++-- ext/phar/tests/tar/delete.phpt | 2 +- ext/phar/tests/tar/delete_in_phar.phpt | 2 +- .../tests/tar/delete_in_phar_confirm.phpt | 2 +- ext/phar/tests/tar/gh16695_1.phpt | 2 +- .../tests/tar/open_for_write_existing_b.phpt | 2 +- .../tests/tar/open_for_write_existing_c.phpt | 2 +- .../tests/tar/open_for_write_newfile_b.phpt | 4 ++-- .../tests/tar/open_for_write_newfile_c.phpt | 4 ++-- ext/phar/tests/tar/rename.phpt | 2 +- ext/phar/tests/tar/rename_dir.phpt | 2 +- ext/phar/tests/tar/tar_001.phpt | 2 +- ext/phar/tests/tar/tar_002.phpt | 2 +- ext/phar/tests/tar/tar_nostub.phpt | 2 +- ext/phar/tests/test_alias_unset.phpt | 2 +- ext/phar/tests/zip/create_new_phar_b.phpt | 4 ++-- ext/phar/tests/zip/delete.phpt | 2 +- ext/phar/tests/zip/delete_in_phar.phpt | 2 +- .../tests/zip/delete_in_phar_confirm.phpt | 2 +- ext/phar/tests/zip/notphar.phpt | 2 +- .../tests/zip/open_for_write_existing_b.phpt | 2 +- .../tests/zip/open_for_write_existing_c.phpt | 2 +- .../tests/zip/open_for_write_newfile_b.phpt | 4 ++-- .../tests/zip/open_for_write_newfile_c.phpt | 4 ++-- ext/phar/tests/zip/rename.phpt | 2 +- ext/phar/tests/zip/rename_dir.phpt | 2 +- ext/standard/tests/dir/bug80960.phpt | 6 ++--- ext/standard/tests/dir/dir_variation5.phpt | 2 +- ext/standard/tests/dir/dir_variation6.phpt | 4 ++-- ext/standard/tests/dir/dir_variation7.phpt | 4 ++-- ext/standard/tests/dir/dir_variation8.phpt | 8 +++---- ext/standard/tests/dir/dir_variation9.phpt | 8 +++---- ext/standard/tests/dir/opendir_error2.phpt | 4 ++-- .../tests/dir/opendir_variation5.phpt | 4 ++-- .../tests/dir/opendir_variation6-win32.phpt | 8 +++---- .../tests/dir/opendir_variation6.phpt | 8 +++---- ext/standard/tests/dir/scandir_error2.phpt | 4 ++-- .../tests/dir/scandir_variation5.phpt | 4 ++-- .../tests/dir/scandir_variation6.phpt | 8 +++---- ext/standard/tests/file/007_variation15.phpt | 2 +- ext/standard/tests/file/007_variation16.phpt | 2 +- ext/standard/tests/file/007_variation23.phpt | 2 +- ext/standard/tests/file/007_variation24.phpt | 2 +- ext/standard/tests/file/007_variation7.phpt | 2 +- ext/standard/tests/file/007_variation8.phpt | 2 +- ext/standard/tests/file/bug35740.phpt | 2 +- ext/standard/tests/file/bug43353.phpt | 4 +++- ext/standard/tests/file/bug76735.phpt | 2 +- ext/standard/tests/file/copy_error.phpt | 2 +- ext/standard/tests/file/copy_variation14.phpt | 4 ++-- ext/standard/tests/file/copy_variation15.phpt | 2 +- .../tests/file/copy_variation16-win32.phpt | 2 +- ext/standard/tests/file/copy_variation17.phpt | 8 +++---- .../tests/file/copy_variation2-win32-mb.phpt | 8 +++---- .../tests/file/copy_variation2-win32.phpt | 8 +++---- .../tests/file/copy_variation3-win32.phpt | 4 ++-- .../tests/file/copy_variation6-win32.phpt | 2 +- ext/standard/tests/file/file_error.phpt | 2 +- .../tests/file/file_get_contents_error.phpt | 5 ++-- .../file_get_contents_error_folder-win.phpt | 2 +- ..._get_contents_file_put_contents_error.phpt | 2 +- ...file_get_contents_variation7-win32-mb.phpt | 6 ++--- .../file_get_contents_variation7-win32.phpt | 6 ++--- .../file/file_get_contents_variation7.phpt | 6 ++--- .../file_get_contents_variation8-win32.phpt | 10 ++++---- .../file/file_get_contents_variation8.phpt | 10 ++++---- ...e_get_contents_with_custom_uri_parser.phpt | 6 ++--- .../file_put_contents_variation7-win32.phpt | 6 ++--- .../file/file_put_contents_variation7.phpt | 6 ++--- .../file_put_contents_variation8-win32.phpt | 6 ++--- .../file/file_put_contents_variation8.phpt | 4 ++-- .../tests/file/file_variation8-win32.phpt | 6 ++--- ext/standard/tests/file/file_variation8.phpt | 6 ++--- .../tests/file/fopen_variation10-win32.phpt | 10 ++++---- .../tests/file/fopen_variation11-win32.phpt | 10 ++++---- .../tests/file/fopen_variation14-win32.phpt | 24 +++++++++---------- .../tests/file/fopen_variation14.phpt | 12 +++++----- .../tests/file/fopen_variation15-win32.phpt | 24 +++++++++---------- .../tests/file/fopen_variation15.phpt | 12 +++++----- .../tests/file/include_userstream_002.phpt | 4 ++-- .../tests/file/include_userstream_003.phpt | 12 +++++----- .../tests/file/open_basedir_cwd_resolve.phpt | 2 +- .../tests/file/parse_ini_file_error.phpt | 4 ++-- .../parse_ini_file_variation6-win32-mb.phpt | 6 ++--- .../file/parse_ini_file_variation6-win32.phpt | 6 ++--- .../tests/file/parse_ini_file_variation6.phpt | 6 ++--- .../tests/file/php_fd_wrapper_03.phpt | 8 +++---- .../tests/file/php_fd_wrapper_04.phpt | 2 +- ext/standard/tests/file/readfile_error.phpt | 2 +- .../file/readfile_variation10-win32.phpt | 10 ++++---- .../tests/file/readfile_variation10.phpt | 10 ++++---- .../file/readfile_variation8-win32-mb.phpt | 6 ++--- .../tests/file/readfile_variation8-win32.phpt | 6 ++--- .../tests/file/readfile_variation9.phpt | 6 ++--- ext/standard/tests/file/stream_001.phpt | 2 +- .../tests/file/stream_rfc2397_002.phpt | 14 +++++------ .../tests/file/stream_rfc2397_006.phpt | 4 ++-- .../tests/general_functions/bug44295-win.phpt | 2 +- .../tests/general_functions/bug44295.phpt | 2 +- .../general_functions/parse_ini_file.phpt | 4 ++-- .../general_functions/proc_open_pipes3.phpt | 2 +- ext/standard/tests/http/bug38802.phpt | 6 ++--- ext/standard/tests/http/bug47021.phpt | 8 +++---- ext/standard/tests/http/bug60570.phpt | 6 ++--- ext/standard/tests/http/bug69337.phpt | 2 +- ext/standard/tests/http/bug76342.phpt | 2 +- ext/standard/tests/http/gh16810.phpt | 2 +- .../tests/http/ghsa-52jp-hrpf-2jff-001.phpt | 2 +- .../tests/http/ghsa-52jp-hrpf-2jff-002.phpt | 2 +- .../tests/http/ghsa-c5f2-jwm7-mmq2.phpt | 8 +------ .../tests/http/ghsa-pcmh-g36c-qc44-001.phpt | 2 +- .../tests/http/ghsa-pcmh-g36c-qc44-002.phpt | 2 +- .../tests/http/ghsa-v8xr-gpvj-cx9g-004.phpt | 2 +- .../tests/http/ghsa-v8xr-gpvj-cx9g-005.phpt | 2 +- .../tests/http/http_response_header_03.phpt | 2 +- ext/standard/tests/http/ignore_errors.phpt | 2 +- .../tests/image/getimagesize_variation3.phpt | 4 ++-- ext/standard/tests/mail/gh7875.phpt | 2 +- ext/standard/tests/streams/bug72771.phpt | 2 +- ext/standard/tests/streams/bug73457.phpt | 2 +- ext/standard/tests/streams/bug74951.phpt | 2 +- ext/standard/tests/streams/glob-wrapper.phpt | 2 +- ext/standard/tests/streams/opendir-001.phpt | 2 +- ext/standard/tests/streams/opendir-003.phpt | 2 +- .../streams/stream_errors_error_has_code.phpt | 2 +- .../streams/stream_errors_invalid_types.phpt | 4 ++-- .../stream_errors_silent_with_handler.phpt | 2 +- .../streams/stream_errors_standard_error.phpt | 2 +- ext/standard/tests/strings/006.phpt | 2 +- ext/standard/tests/strings/007-win32.phpt | 2 +- ext/standard/tests/strings/007.phpt | 2 +- ext/standard/tests/strings/bug68996.phpt | 2 +- .../tests/strings/highlight_file.phpt | 2 +- ext/standard/tests/strings/md5_file.phpt | 4 ++-- .../tests/strings/php_strip_whitespace.phpt | 2 +- ext/standard/tests/strings/sha1.phpt | 2 +- ext/standard/tests/strings/sha1_file.phpt | 4 ++-- ext/zend_test/tests/gh17797.phpt | 2 +- ext/zend_test/tests/gh17899.phpt | 2 +- ext/zip/tests/bug53603.phpt | 2 +- ext/zip/tests/oo_encryption.phpt | 2 +- ext/zlib/tests/gzfile_variation7.phpt | 4 ++-- ext/zlib/tests/gzopen_variation9.phpt | 2 +- ext/zlib/tests/readgzfile_variation7.phpt | 4 ++-- ext/zlib/tests/zlib_scheme_dir_basic.phpt | 2 +- main/streams/php_stream_errors.h | 4 ++-- main/streams/stream_errors.c | 11 ++++----- main/streams/streams.c | 4 ++-- sapi/cli/tests/bug69655.phpt | 6 ++--- sapi/cli/tests/bug70264.phpt | 4 ++-- sapi/cli/tests/bug73630a.phpt | 2 +- sapi/phpdbg/tests/bug78297.phpt | 2 +- tests/lang/bug28213.phpt | 2 +- tests/lang/bug35176.phpt | 2 +- tests/lang/bug43958.phpt | 2 +- tests/output/bug75236.phpt | 2 +- tests/security/open_basedir_copy.phpt | 16 ++++++------- tests/security/open_basedir_dir.phpt | 16 ++++++------- .../open_basedir_error_log_variation.phpt | 6 ++--- tests/security/open_basedir_file.phpt | 16 ++++++------- .../open_basedir_file_get_contents.phpt | 16 ++++++------- .../open_basedir_file_put_contents.phpt | 10 ++++---- tests/security/open_basedir_fopen.phpt | 16 ++++++------- tests/security/open_basedir_opendir.phpt | 16 ++++++------- .../security/open_basedir_parse_ini_file.phpt | 14 +++++------ tests/security/open_basedir_scandir.phpt | 16 ++++++------- 229 files changed, 523 insertions(+), 529 deletions(-) diff --git a/Zend/tests/backtrace/debug_backtrace_with_include_and_this.phpt b/Zend/tests/backtrace/debug_backtrace_with_include_and_this.phpt index 49796a9b9103..18f155611f42 100644 --- a/Zend/tests/backtrace/debug_backtrace_with_include_and_this.phpt +++ b/Zend/tests/backtrace/debug_backtrace_with_include_and_this.phpt @@ -30,7 +30,7 @@ try { } ?> --EXPECTF-- -ERR#2: include(class://non.existent.Class): Failed to open stream: "CLWrapper::stream_open" call failed @ include +ERR#2: include(): Failed to open stream: "CLWrapper::stream_open" call failed @ include ERR#2: include(): Failed opening 'class://non.existent.Class' for inclusion (include_path='%s') @ include Fatal error: Uncaught Exception: Failed loading class://non.existent.Class in %s diff --git a/Zend/tests/bug30998.phpt b/Zend/tests/bug30998.phpt index 9d8435121671..a4cd6de8f50e 100644 --- a/Zend/tests/bug30998.phpt +++ b/Zend/tests/bug30998.phpt @@ -14,6 +14,6 @@ set_error_handler('my_error'); $f = fopen("/tmp/blah", "r"); ?> --EXPECTF-- -fopen(/tmp/blah): Failed to open stream: %s (2) in %s:%d +fopen(): Failed to open stream: %s (2) in %s:%d -Warning: fopen(/tmp/blah): Failed to open stream: %s in %s on line %d +Warning: fopen(): Failed to open stream: %s in %s on line %d diff --git a/Zend/tests/bug60909_1.phpt b/Zend/tests/bug60909_1.phpt index 4404adfd54a3..bde5a381ba47 100644 --- a/Zend/tests/bug60909_1.phpt +++ b/Zend/tests/bug60909_1.phpt @@ -11,10 +11,10 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){ require 'notfound.php'; ?> --EXPECTF-- -error(require(notfound.php): Failed to open stream: %s) +error(require(): Failed to open stream: %s) Fatal error: Uncaught Exception: Foo in %sbug60909_1.php:5 Stack trace: -#0 %s(%d): {closure:%s:%d}(2, 'require(notfoun...', '%s', 8) +#0 %s(%d): {closure:%s:%d}(2, 'require(): Fail...', '%s', 8) #1 %sbug60909_1.php(8): require() #2 {main} thrown in %sbug60909_1.php on line 5 diff --git a/Zend/tests/gh11735_2.phpt b/Zend/tests/gh11735_2.phpt index b568b6f6df37..521862b48237 100644 --- a/Zend/tests/gh11735_2.phpt +++ b/Zend/tests/gh11735_2.phpt @@ -13,5 +13,5 @@ stream_wrapper_register('foo', 'FooWrapper'); var_dump(fopen('foo://bar', 'r')); ?> --EXPECTF-- -Warning: fopen(foo://bar): Failed to open stream: "FooWrapper::stream_open" call failed in %s on line %d +Warning: fopen(): Failed to open stream: "FooWrapper::stream_open" call failed in %s on line %d bool(false) diff --git a/Zend/tests/include_stat_is_quiet.phpt b/Zend/tests/include_stat_is_quiet.phpt index 75ba8f3d6273..39eb3053fbe4 100644 --- a/Zend/tests/include_stat_is_quiet.phpt +++ b/Zend/tests/include_stat_is_quiet.phpt @@ -26,7 +26,7 @@ try { ?> --EXPECTF-- -Warning: require_once(doesnt_exist.php): Failed to open stream: No such file or directory in %s on line %d +Warning: require_once(): Failed to open stream: No such file or directory in %s on line %d Fatal error: Uncaught Error: Failed opening required 'doesnt_exist.php' (include_path='test://foo:test://bar') in %s:%d Stack trace: diff --git a/Zend/tests/oss_fuzz_64209.phpt b/Zend/tests/oss_fuzz_64209.phpt index 599ae258e5b2..56b9dcfc7a24 100644 --- a/Zend/tests/oss_fuzz_64209.phpt +++ b/Zend/tests/oss_fuzz_64209.phpt @@ -5,7 +5,7 @@ oss-fuzz #64209: Fix in-place modification of filename in php_message_handler_fo require '://@'; ?> --EXPECTF-- -Warning: require(://@): Failed to open stream: No such file or directory in %s on line %d +Warning: require(): Failed to open stream: No such file or directory in %s on line %d Fatal error: Uncaught Error: Failed opening required '://@' (include_path='%s') in %s:%d Stack trace: diff --git a/Zend/tests/require_once_warning_to_exception.phpt b/Zend/tests/require_once_warning_to_exception.phpt index d115ac68ccde..bc706622438f 100644 --- a/Zend/tests/require_once_warning_to_exception.phpt +++ b/Zend/tests/require_once_warning_to_exception.phpt @@ -16,4 +16,4 @@ try { ?> --EXPECT-- -require_once(does-not-exist.php): Failed to open stream: No such file or directory +require_once(): Failed to open stream: No such file or directory diff --git a/ext/bz2/tests/001.phpt b/ext/bz2/tests/001.phpt index 767a50a27d8b..6323a224c3ac 100644 --- a/ext/bz2/tests/001.phpt +++ b/ext/bz2/tests/001.phpt @@ -48,6 +48,6 @@ bzopen(): Argument #2 ($mode) must be either "r" or "w" bzopen(): Argument #2 ($mode) must be either "r" or "w" bzopen(): Argument #2 ($mode) must be either "r" or "w" -Warning: bzopen(no_such_file): Failed to open stream: No such file or directory in %s on line %d +Warning: bzopen(): Failed to open stream: No such file or directory in %s on line %d bool(false) resource(%d) of type (stream) diff --git a/ext/bz2/tests/002.phpt b/ext/bz2/tests/002.phpt index f87048f92314..7210f90a4d92 100644 --- a/ext/bz2/tests/002.phpt +++ b/ext/bz2/tests/002.phpt @@ -90,10 +90,10 @@ bool(false) resource(%d) of type (stream) resource(%d) of type (stream) -Warning: fopen(bz_open_002.txt): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d +Warning: fopen(): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d bzopen(): Argument #1 ($file) must be of type string or file-resource, false given -Warning: fopen(bz_open_002.txt): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d +Warning: fopen(): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d bzopen(): Argument #1 ($file) must be of type string or file-resource, false given Warning: bzopen(): cannot write to a stream opened in read only mode in %s on line %d diff --git a/ext/dba/tests/dba_cdb_creation_matrix.phpt b/ext/dba/tests/dba_cdb_creation_matrix.phpt index 36880911c89c..c7dda5b61b68 100644 --- a/ext/dba/tests/dba_cdb_creation_matrix.phpt +++ b/ext/dba/tests/dba_cdb_creation_matrix.phpt @@ -25,35 +25,35 @@ clean_creation_tests($handler); === OPENING NON-EXISTING FILE === Mode parameter is "rl": -Warning: dba_open(cdb_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "rd": -Warning: dba_open(cdb_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "r-": -Warning: dba_open(cdb_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "r": -Warning: dba_open(cdb_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "wl": -Warning: dba_open(cdb_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "wd": -Warning: dba_open(cdb_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "w-": -Warning: dba_open(cdb_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "w": -Warning: dba_open(cdb_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "cl": diff --git a/ext/dba/tests/dba_flatfile_creation_matrix.phpt b/ext/dba/tests/dba_flatfile_creation_matrix.phpt index 6009c0778941..d10523f9b1e4 100644 --- a/ext/dba/tests/dba_flatfile_creation_matrix.phpt +++ b/ext/dba/tests/dba_flatfile_creation_matrix.phpt @@ -25,35 +25,35 @@ clean_creation_tests($handler); === OPENING NON-EXISTING FILE === Mode parameter is "rl": -Warning: dba_open(flatfile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "rd": -Warning: dba_open(flatfile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "r-": -Warning: dba_open(flatfile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "r": -Warning: dba_open(flatfile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "wl": -Warning: dba_open(flatfile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "wd": -Warning: dba_open(flatfile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "w-": -Warning: dba_open(flatfile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "w": -Warning: dba_open(flatfile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "cl": This is a test insert diff --git a/ext/dba/tests/dba_inifile_creation_matrix.phpt b/ext/dba/tests/dba_inifile_creation_matrix.phpt index aff1fdfb4f16..2e93e865e3e6 100644 --- a/ext/dba/tests/dba_inifile_creation_matrix.phpt +++ b/ext/dba/tests/dba_inifile_creation_matrix.phpt @@ -25,35 +25,35 @@ clean_creation_tests($handler); === OPENING NON-EXISTING FILE === Mode parameter is "rl": -Warning: dba_open(inifile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "rd": -Warning: dba_open(inifile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "r-": -Warning: dba_open(inifile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "r": -Warning: dba_open(inifile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "wl": -Warning: dba_open(inifile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "wd": -Warning: dba_open(inifile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "w-": -Warning: dba_open(inifile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "w": -Warning: dba_open(inifile_not_existing.db): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "cl": This is a test insert diff --git a/ext/dba/tests/dba_tcadb_creation_matrix.phpt b/ext/dba/tests/dba_tcadb_creation_matrix.phpt index e86efce75cae..928729777741 100644 --- a/ext/dba/tests/dba_tcadb_creation_matrix.phpt +++ b/ext/dba/tests/dba_tcadb_creation_matrix.phpt @@ -29,7 +29,7 @@ Warning: dba_open(): Driver initialization failed for handler: tcadb in %s on li Opening DB failed Mode parameter is "rd": -Warning: dba_open(tcadb_not_existing.tch): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "r-": @@ -37,7 +37,7 @@ Warning: dba_open(): Driver initialization failed for handler: tcadb in %s on li Opening DB failed Mode parameter is "r": -Warning: dba_open(tcadb_not_existing.tch): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "wl": @@ -45,7 +45,7 @@ Warning: dba_open(): Driver initialization failed for handler: tcadb in %s on li Opening DB failed Mode parameter is "wd": -Warning: dba_open(tcadb_not_existing.tch): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "w-": @@ -53,7 +53,7 @@ Warning: dba_open(): Driver initialization failed for handler: tcadb in %s on li Opening DB failed Mode parameter is "w": -Warning: dba_open(tcadb_not_existing.tch): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_open(): Failed to open stream: No such file or directory in %s on line %d Opening DB failed Mode parameter is "cl": This is a test insert diff --git a/ext/dba/tests/gh18247.phpt b/ext/dba/tests/gh18247.phpt index bb757452321d..c7bc0277dc20 100644 --- a/ext/dba/tests/gh18247.phpt +++ b/ext/dba/tests/gh18247.phpt @@ -8,5 +8,5 @@ var_dump(dba_popen('/inexistent', 'r')); ?> --EXPECTF-- -Warning: dba_popen(/inexistent): Failed to open stream: No such file or directory in %s on line %d +Warning: dba_popen(): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/dom/tests/modern/html/parser/HTMLDocument_fromFile_local_file_does_not_exist.phpt b/ext/dom/tests/modern/html/parser/HTMLDocument_fromFile_local_file_does_not_exist.phpt index ce96afd69eb3..52e709e4a0ca 100644 --- a/ext/dom/tests/modern/html/parser/HTMLDocument_fromFile_local_file_does_not_exist.phpt +++ b/ext/dom/tests/modern/html/parser/HTMLDocument_fromFile_local_file_does_not_exist.phpt @@ -10,7 +10,7 @@ echo $dom->saveHtml(), "\n"; ?> --EXPECTF-- -Warning: Dom\HTMLDocument::createFromFile(%s): Failed to open stream: No such file or directory in %s on line %d +Warning: Dom\HTMLDocument::createFromFile(): Failed to open stream: No such file or directory in %s on line %d Fatal error: Uncaught Exception: Cannot open file '%s' in %s:%d Stack trace: diff --git a/ext/exif/tests/exif_imagetype_error.phpt b/ext/exif/tests/exif_imagetype_error.phpt index 2d78234c2f0c..36fe66adb095 100644 --- a/ext/exif/tests/exif_imagetype_error.phpt +++ b/ext/exif/tests/exif_imagetype_error.phpt @@ -17,5 +17,5 @@ var_dump( exif_imagetype(__DIR__.'/foo.jpg') ); -- Testing exif_imagetype() function with an unknown file -- -Warning: exif_imagetype(%s/foo.jpg): Failed to open stream: No such file or directory in %s on line %d +Warning: exif_imagetype(): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/fileinfo/tests/bug68996.phpt b/ext/fileinfo/tests/bug68996.phpt index 7dbbf4f7f07a..4f4716336e8e 100644 --- a/ext/fileinfo/tests/bug68996.phpt +++ b/ext/fileinfo/tests/bug68996.phpt @@ -10,8 +10,8 @@ finfo_open(FILEINFO_MIME_TYPE, "\xfc\x63"); ?> --EXPECTF--
-Warning: finfo_open(%s�c): Failed to open stream: No such file or directory in %sbug68996.php on line %d
+Warning: finfo_open(): Failed to open stream: No such file or directory in %sbug68996.php on line %d

-Warning: finfo_open(%s�c): Failed to open stream: No such file or directory in %sbug68996.php on line %d
+Warning: finfo_open(): Failed to open stream: No such file or directory in %sbug68996.php on line %d

Warning: finfo_open(): Failed to load magic database at "%s�c" in %s on line %d
diff --git a/ext/fileinfo/tests/finfo_file_001.phpt b/ext/fileinfo/tests/finfo_file_001.phpt index 737b8db53ff7..91b9b69717f6 100644 --- a/ext/fileinfo/tests/finfo_file_001.phpt +++ b/ext/fileinfo/tests/finfo_file_001.phpt @@ -25,5 +25,5 @@ finfo_file(): Argument #2 ($filename) must not contain any null bytes finfo_file(): Argument #2 ($filename) must not be empty string(9) "directory" -Warning: finfo_file(&): Failed to open stream: No such file or directory in %s on line %d +Warning: finfo_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/fileinfo/tests/finfo_open_001.phpt b/ext/fileinfo/tests/finfo_open_001.phpt index 21b90042f0fd..2ed7168e90d3 100644 --- a/ext/fileinfo/tests/finfo_open_001.phpt +++ b/ext/fileinfo/tests/finfo_open_001.phpt @@ -44,23 +44,23 @@ object(finfo)#%d (0) { object(finfo)#%d (0) { } -Warning: finfo_open(%s123): Failed to open stream: No such file or directory in %s on line %d +Warning: finfo_open(): Failed to open stream: No such file or directory in %s on line %d -Warning: finfo_open(%s123): Failed to open stream: No such file or directory in %s on line %d +Warning: finfo_open(): Failed to open stream: No such file or directory in %s on line %d Warning: finfo_open(): Failed to load magic database at "%s123" in %s on line %d bool(false) -Warning: finfo_open(%s1): Failed to open stream: No such file or directory in %s on line %d +Warning: finfo_open(): Failed to open stream: No such file or directory in %s on line %d -Warning: finfo_open(%s1): Failed to open stream: No such file or directory in %s on line %d +Warning: finfo_open(): Failed to open stream: No such file or directory in %s on line %d Warning: finfo_open(): Failed to load magic database at "%s1" in %s on line %d bool(false) -Warning: finfo_open(%sinexistent): Failed to open stream: No such file or directory in %s on line %d +Warning: finfo_open(): Failed to open stream: No such file or directory in %s on line %d -Warning: finfo_open(%sinexistent): Failed to open stream: No such file or directory in %s on line %d +Warning: finfo_open(): Failed to open stream: No such file or directory in %s on line %d Warning: finfo_open(): Failed to load magic database at "%sinexistent" in %s on line %d bool(false) @@ -68,6 +68,6 @@ object(finfo)#%d (%d) { } object(finfo)#%d (%d) { } -finfo::__construct(%s123): Failed to open stream: No such file or directory -finfo::__construct(%s1): Failed to open stream: No such file or directory -finfo::__construct(%sinexistent): Failed to open stream: No such file or directory +finfo::__construct(): Failed to open stream: No such file or directory +finfo::__construct(): Failed to open stream: No such file or directory +finfo::__construct(): Failed to open stream: No such file or directory diff --git a/ext/fileinfo/tests/finfo_open_error.phpt b/ext/fileinfo/tests/finfo_open_error.phpt index c4aa082111d7..7c6fc9766372 100644 --- a/ext/fileinfo/tests/finfo_open_error.phpt +++ b/ext/fileinfo/tests/finfo_open_error.phpt @@ -27,9 +27,9 @@ try { --EXPECTF-- *** Testing finfo_open() : error functionality *** -Warning: finfo_open(%sfoobarfile): Failed to open stream: No such file or directory in %sfinfo_open_error.php on line %d +Warning: finfo_open(): Failed to open stream: No such file or directory in %sfinfo_open_error.php on line %d -Warning: finfo_open(%sfoobarfile): Failed to open stream: No such file or directory in %sfinfo_open_error.php on line %d +Warning: finfo_open(): Failed to open stream: No such file or directory in %sfinfo_open_error.php on line %d Warning: finfo_open(): Failed to load magic database at "%sfoobarfile" in %sfinfo_open_error.php on line %d bool(false) diff --git a/ext/fileinfo/tests/mime_content_type_001.phpt b/ext/fileinfo/tests/mime_content_type_001.phpt index 98c1325959d8..93b145768141 100644 --- a/ext/fileinfo/tests/mime_content_type_001.phpt +++ b/ext/fileinfo/tests/mime_content_type_001.phpt @@ -46,6 +46,6 @@ mime_content_type(): Argument #1 ($filename) must be of type resource|string, nu mime_content_type(): Argument #1 ($filename) must be of type resource|string, stdClass given mime_content_type(): Argument #1 ($filename) must be of type resource|string, array given -Warning: mime_content_type(foo/inexistent): Failed to open stream: No such file or directory in %s on line %d +Warning: mime_content_type(): Failed to open stream: No such file or directory in %s on line %d mime_content_type(): Argument #1 ($filename) must not be empty mime_content_type(): Argument #1 ($filename) must not contain any null bytes diff --git a/ext/gd/tests/001-mb.phpt b/ext/gd/tests/001-mb.phpt index 3093a59783d6..4c0971cf194f 100644 --- a/ext/gd/tests/001-mb.phpt +++ b/ext/gd/tests/001-mb.phpt @@ -19,7 +19,7 @@ var_dump(imagecreatefrompng($file)); echo "Done\n"; ?> --EXPECTF-- -Warning: imagecreatefrompng(%s001私はガラスを食べられます.test): Failed to open stream: No such file or directory in %s on line %d +Warning: imagecreatefrompng(): Failed to open stream: No such file or directory in %s on line %d bool(false) Warning: imagecreatefrompng(): "%s001私はガラスを食べられます.test" is not a valid PNG file in %s on line %d diff --git a/ext/gd/tests/001.phpt b/ext/gd/tests/001.phpt index 7c2fcf365231..a589a66ffa06 100644 --- a/ext/gd/tests/001.phpt +++ b/ext/gd/tests/001.phpt @@ -19,7 +19,7 @@ var_dump(imagecreatefrompng($file)); echo "Done\n"; ?> --EXPECTF-- -Warning: imagecreatefrompng(%s001.test): Failed to open stream: No such file or directory in %s on line %d +Warning: imagecreatefrompng(): Failed to open stream: No such file or directory in %s on line %d bool(false) Warning: imagecreatefrompng(): "%s001.test" is not a valid PNG file in %s on line %d diff --git a/ext/gd/tests/imageloadfont_error2.phpt b/ext/gd/tests/imageloadfont_error2.phpt index 76984876801b..3a60df5b70dc 100644 --- a/ext/gd/tests/imageloadfont_error2.phpt +++ b/ext/gd/tests/imageloadfont_error2.phpt @@ -9,5 +9,5 @@ gd var_dump( imageloadfont('\src\invalidfile.font') ); ?> --EXPECTF-- -Warning: imageloadfont(\src\invalidfile.font): Failed to open stream: No such file or directory in %s on line %d +Warning: imageloadfont(): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/hash/tests/hash_file_error.phpt b/ext/hash/tests/hash_file_error.phpt index 44f3d0925597..68ba55f4a373 100644 --- a/ext/hash/tests/hash_file_error.phpt +++ b/ext/hash/tests/hash_file_error.phpt @@ -38,5 +38,5 @@ hash_file(): Argument #1 ($algo) must be a valid hashing algorithm -- Testing hash_file() function with a non-existent file -- -Warning: hash_file(%s): Failed to open stream: No such file or directory in %s on line %d +Warning: hash_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/libxml/tests/bug61367-write.phpt b/ext/libxml/tests/bug61367-write.phpt index f11f10952204..e8f004471645 100644 --- a/ext/libxml/tests/bug61367-write.phpt +++ b/ext/libxml/tests/bug61367-write.phpt @@ -44,5 +44,5 @@ bool(true) Warning: DOMDocument::save(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d -Warning: DOMDocument::save(%s): Failed to open stream: %r(Operation not permitted|Insufficient privileges)%r in %s on line %d +Warning: DOMDocument::save(): Failed to open stream: %r(Operation not permitted|Insufficient privileges)%r in %s on line %d bool(false) diff --git a/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt b/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt index 70e18584326c..2a1a54d6b65f 100644 --- a/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt +++ b/ext/mysqli/tests/mysqli_pam_sha256_public_key_option_invalid.phpt @@ -179,7 +179,7 @@ Warning: mysqli::real_connect(): (HY000/1045): %s in %s on line %d Warning: mysqli::real_connect(): (HY000/1045): %s in %s on line %d [300 + 002] [1045] %s -Warning: mysqli::real_connect(%sest_sha256_wrong_%d): Failed to open stream: No such file or directory in %s on line %d +Warning: mysqli::real_connect(): Failed to open stream: No such file or directory in %s on line %d Warning: mysqli::real_connect(): (HY000/1045): %s in %s on line %d [400 + 002] [1045] %s diff --git a/ext/openssl/tests/bug65538_002.phpt b/ext/openssl/tests/bug65538_002.phpt index 44a322c6828f..853695723379 100644 --- a/ext/openssl/tests/bug65538_002.phpt +++ b/ext/openssl/tests/bug65538_002.phpt @@ -23,4 +23,4 @@ Warning: remote cafile streams are disabled for security purposes in %s on line Warning: file_get_contents(): Failed to enable crypto in %s on line %d -Warning: file_get_contents(%s): Failed to open stream: operation failed in %s on line %d +Warning: file_get_contents(): Failed to open stream: operation failed in %s on line %d diff --git a/ext/phar/tests/013.phpt b/ext/phar/tests/013.phpt index f0315b151bef..63bdabb31833 100644 --- a/ext/phar/tests/013.phpt +++ b/ext/phar/tests/013.phpt @@ -20,4 +20,4 @@ echo file_get_contents($pname.'/a'); --CLEAN-- --EXPECTF-- -Warning: file_get_contents(phar://%s/a): Failed to open stream: phar error: internal corruption of phar "%s" (%s file "a") in %s on line %d +Warning: file_get_contents(): Failed to open stream: phar error: internal corruption of phar "%s" (%s file "a") in %s on line %d diff --git a/ext/phar/tests/014.phpt b/ext/phar/tests/014.phpt index 7b2a6d0166e8..7ce06ce5d912 100644 --- a/ext/phar/tests/014.phpt +++ b/ext/phar/tests/014.phpt @@ -20,4 +20,4 @@ echo file_get_contents($pname.'/a'); --CLEAN-- --EXPECTF-- -Warning: file_get_contents(phar://%s/a): Failed to open stream: phar error: internal corruption of phar "%s" (crc32 mismatch on file "a") in %s on line %d +Warning: file_get_contents(): Failed to open stream: phar error: internal corruption of phar "%s" (crc32 mismatch on file "a") in %s on line %d diff --git a/ext/phar/tests/016.phpt b/ext/phar/tests/016.phpt index d14c1292a6e2..17052735b044 100644 --- a/ext/phar/tests/016.phpt +++ b/ext/phar/tests/016.phpt @@ -28,12 +28,12 @@ var_dump(file_get_contents($pname . '/d')); --CLEAN-- --EXPECTF-- -Warning: file_get_contents(phar://%s/a): Failed to open stream: phar error: internal corruption of phar "%s" (actual filesize mismatch on file "a") in %s on line %d +Warning: file_get_contents(): Failed to open stream: phar error: internal corruption of phar "%s" (actual filesize mismatch on file "a") in %s on line %d bool(false) -Warning: file_get_contents(phar://%s/b): Failed to open stream: phar error: internal corruption of phar "%s" (actual filesize mismatch on file "b") in %s on line %d +Warning: file_get_contents(): Failed to open stream: phar error: internal corruption of phar "%s" (actual filesize mismatch on file "b") in %s on line %d bool(false) string(1) "*" -Warning: file_get_contents(phar://%s/d): Failed to open stream: phar error: internal corruption of phar "%s" (actual filesize mismatch on file "d") in %s on line %d +Warning: file_get_contents(): Failed to open stream: phar error: internal corruption of phar "%s" (actual filesize mismatch on file "d") in %s on line %d bool(false) diff --git a/ext/phar/tests/016b.phpt b/ext/phar/tests/016b.phpt index 72b7019def54..ba07a10bb752 100644 --- a/ext/phar/tests/016b.phpt +++ b/ext/phar/tests/016b.phpt @@ -21,4 +21,4 @@ echo file_get_contents($pname . '/a'); --CLEAN-- --EXPECTF-- -Warning: file_get_contents(phar://%s/a): Failed to open stream: phar error: internal corruption of phar "%s" (actual filesize mismatch on file "a") in %s on line %d +Warning: file_get_contents(): Failed to open stream: phar error: internal corruption of phar "%s" (actual filesize mismatch on file "a") in %s on line %d diff --git a/ext/phar/tests/017.phpt b/ext/phar/tests/017.phpt index 74ffddad40b5..14ebddc787e7 100644 --- a/ext/phar/tests/017.phpt +++ b/ext/phar/tests/017.phpt @@ -27,5 +27,5 @@ $dir = opendir('phar://hio'); string(%d) "%s017.phar.php" bool(true) -Warning: opendir(phar://hio): Failed to open directory: phar error: no directory in "phar://hio", must have at least phar://hio/ for root directory (always use full path to a new phar) +Warning: opendir(): Failed to open directory: phar error: no directory in "phar://hio", must have at least phar://hio/ for root directory (always use full path to a new phar) phar url "phar://hio" is unknown in %s017.php on line %d diff --git a/ext/phar/tests/027.phpt b/ext/phar/tests/027.phpt index e5c2add435e6..b285f16f8088 100644 --- a/ext/phar/tests/027.phpt +++ b/ext/phar/tests/027.phpt @@ -83,10 +83,10 @@ bool(false) bool(false) opendir edge cases -Warning: opendir(phar://): Failed to open directory: phar error: no directory in "phar://", must have at least phar:/// for root directory (always use full path to a new phar) +Warning: opendir(): Failed to open directory: phar error: no directory in "phar://", must have at least phar:/// for root directory (always use full path to a new phar) phar url "phar://" is unknown in %s027.php on line %d bool(false) -Warning: opendir(phar://foo.phar/hi): Failed to open directory: phar error: invalid url or non-existent phar "phar://foo.phar/hi" +Warning: opendir(): Failed to open directory: phar error: invalid url or non-existent phar "phar://foo.phar/hi" phar url "phar://foo.phar/hi" is unknown in %s027.php on line %d bool(false) diff --git a/ext/phar/tests/bug69720.phpt b/ext/phar/tests/bug69720.phpt index a6afe0f15e7f..dbcae78db733 100644 --- a/ext/phar/tests/bug69720.phpt +++ b/ext/phar/tests/bug69720.phpt @@ -24,7 +24,7 @@ try { --EXPECTF-- MY_METADATA_NULL -Warning: file_get_contents(phar://%s): Failed to open stream: phar error: "test.php" is not a file in phar "%s.phar" in %s.php on line %d +Warning: file_get_contents(): Failed to open stream: phar error: "test.php" is not a file in phar "%s.phar" in %s.php on line %d array(1) { ["whatever"]=> int(123) diff --git a/ext/phar/tests/bug77432.phpt b/ext/phar/tests/bug77432.phpt index 86a07fe99a4e..1223575badf6 100644 --- a/ext/phar/tests/bug77432.phpt +++ b/ext/phar/tests/bug77432.phpt @@ -39,6 +39,6 @@ hello world hello world --- After unlink --- -Warning: include(%sbug77432.phar): Failed to open stream: phar error: could not reopen phar "%sbug77432.phar" in %s on line %d +Warning: include(): Failed to open stream: phar error: could not reopen phar "%sbug77432.phar" in %s on line %d Warning: include(): Failed opening '%sbug77432.phar' for inclusion (include_path=%s) in %s on line %d diff --git a/ext/phar/tests/bug81726.phpt b/ext/phar/tests/bug81726.phpt index a86c52a64980..e27f9d7e2f3f 100644 --- a/ext/phar/tests/bug81726.phpt +++ b/ext/phar/tests/bug81726.phpt @@ -8,5 +8,5 @@ zlib var_dump(fopen("phar://" . __DIR__ . "/bug81726.gz", "r")); ?> --EXPECTF-- -Warning: fopen(phar://%s): Failed to open stream: unable to decompress gzipped phar archive "%s" in %s on line %d +Warning: fopen(): Failed to open stream: unable to decompress gzipped phar archive "%s" in %s on line %d bool(false) diff --git a/ext/phar/tests/cache_list/frontcontroller22.phpt b/ext/phar/tests/cache_list/frontcontroller22.phpt index 6747da6dc795..ac12e7ef01c6 100644 --- a/ext/phar/tests/cache_list/frontcontroller22.phpt +++ b/ext/phar/tests/cache_list/frontcontroller22.phpt @@ -21,6 +21,6 @@ Content-type: text/html; charset=UTF-8 string(4) "test" string(12) "oof/test.php" -Warning: include(./hi.php): Failed to open stream: No such file or directory in phar://%s/oof/test.php on line %d +Warning: include(): Failed to open stream: No such file or directory in phar://%s/oof/test.php on line %d Warning: include(): Failed opening './hi.php' for inclusion (include_path='%s') in phar://%soof/test.php on line %d diff --git a/ext/phar/tests/create_new_phar_b.phpt b/ext/phar/tests/create_new_phar_b.phpt index fb106153ca87..9d9c8640dd5f 100644 --- a/ext/phar/tests/create_new_phar_b.phpt +++ b/ext/phar/tests/create_new_phar_b.phpt @@ -13,9 +13,9 @@ file_put_contents('phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.pha include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php/a.php'; ?> --EXPECTF-- -Warning: file_put_contents(phar://%screate_new_phar_b.phar.php/a.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %screate_new_phar_b.php on line %d +Warning: file_put_contents(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %screate_new_phar_b.php on line %d -Warning: include(phar://%screate_new_phar_b.phar.php/a.php): Failed to open stream: %s in %screate_new_phar_b.php on line %d +Warning: include(): Failed to open stream: %s in %screate_new_phar_b.php on line %d Warning: include(): Failed opening 'phar://%screate_new_phar_b.phar.php/a.php' for inclusion (include_path='%s') in %screate_new_phar_b.php on line %d diff --git a/ext/phar/tests/create_path_error.phpt b/ext/phar/tests/create_path_error.phpt index fea390e477cb..13a0fea2bb7f 100644 --- a/ext/phar/tests/create_path_error.phpt +++ b/ext/phar/tests/create_path_error.phpt @@ -65,17 +65,17 @@ foreach($checks as $check) --EXPECTF-- string(5) "query" string(5) "query" -1:Error: file_put_contents(phar://%s//): Failed to open stream: phar error: file "" in phar "%s" must not be empty -2:Error: file_put_contents(phar://%s/.): Failed to open stream: phar error: file "" in phar "%s" must not be empty -3:Error: file_put_contents(phar://%s/../): Failed to open stream: phar error: file "" in phar "%s" must not be empty -4:Error: file_put_contents(phar://%s/a/..): Failed to open stream: phar error: file "" in phar "%s" must not be empty +1:Error: file_put_contents(): Failed to open stream: phar error: file "" in phar "%s" must not be empty +2:Error: file_put_contents(): Failed to open stream: phar error: file "" in phar "%s" must not be empty +3:Error: file_put_contents(): Failed to open stream: phar error: file "" in phar "%s" must not be empty +4:Error: file_put_contents(): Failed to open stream: phar error: file "" in phar "%s" must not be empty 5: 6: 7: 8: -9:Error: file_put_contents(phar://%s): Failed to open stream: phar error: invalid path "%s" contains illegal character -10:Error: file_put_contents(phar://%s): Failed to open stream: phar error: invalid path "%s" contains illegal character -11:Error: file_put_contents(phar://%s): Failed to open stream: phar error: invalid path "%s" contains illegal character -12:Error: file_put_contents(phar://%s): Failed to open stream: phar error: invalid path "%s" contains illegal character -13:Error: file_put_contents(phar://%s): Failed to open stream: phar error: invalid path "%s" contains illegal character +9:Error: file_put_contents(): Failed to open stream: phar error: invalid path "%s" contains illegal character +10:Error: file_put_contents(): Failed to open stream: phar error: invalid path "%s" contains illegal character +11:Error: file_put_contents(): Failed to open stream: phar error: invalid path "%s" contains illegal character +12:Error: file_put_contents(): Failed to open stream: phar error: invalid path "%s" contains illegal character +13:Error: file_put_contents(): Failed to open stream: phar error: invalid path "%s" contains illegal character Exception: Phar::offsetSet(): Argument #1 ($localName) must not contain any null bytes diff --git a/ext/phar/tests/delete.phpt b/ext/phar/tests/delete.phpt index 1cf95cb82d5b..3264e7312638 100644 --- a/ext/phar/tests/delete.phpt +++ b/ext/phar/tests/delete.phpt @@ -28,4 +28,4 @@ echo file_get_contents($pname . '/a') . "\n"; --EXPECTF-- a -Warning: file_get_contents(phar://%sdelete.phar.php/a): Failed to open stream: phar error: "a" is not a file in phar "%sdelete.phar.php" in %sdelete.php on line 16 +Warning: file_get_contents(): Failed to open stream: phar error: "a" is not a file in phar "%sdelete.phar.php" in %sdelete.php on line 16 diff --git a/ext/phar/tests/delete_in_phar.phpt b/ext/phar/tests/delete_in_phar.phpt index 11978fdce7bc..78149bf87619 100644 --- a/ext/phar/tests/delete_in_phar.phpt +++ b/ext/phar/tests/delete_in_phar.phpt @@ -41,7 +41,7 @@ This is b/c This is a This is b -Warning: include(%sdelete_in_phar.phar.php/b/c.php): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.php" in %sdelete_in_phar.php on line %d +Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.php" in %sdelete_in_phar.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.php/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d diff --git a/ext/phar/tests/delete_in_phar_confirm.phpt b/ext/phar/tests/delete_in_phar_confirm.phpt index 12d1099bf635..215f20ddf9cf 100644 --- a/ext/phar/tests/delete_in_phar_confirm.phpt +++ b/ext/phar/tests/delete_in_phar_confirm.phpt @@ -45,7 +45,7 @@ This is b/c This is a This is b -Warning: include(%sdelete_in_phar_confirm.phar.php/b/c.php): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.php" in %sdelete_in_phar_confirm.php on line %d +Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.php" in %sdelete_in_phar_confirm.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.php/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d diff --git a/ext/phar/tests/fgc_edgecases.phpt b/ext/phar/tests/fgc_edgecases.phpt index 81a2f43e80a1..1daa3a13e59b 100644 --- a/ext/phar/tests/fgc_edgecases.phpt +++ b/ext/phar/tests/fgc_edgecases.phpt @@ -90,7 +90,7 @@ echo file_get_contents("./hi"); echo file_get_contents("./hi", 0, $context, 0, 0); ?> -Warning: file_get_contents(phar://%sfgc_edgecases.phar.php/oops): Failed to open stream: phar error: path "oops" is a directory in phar://%sfgc_edgecases.phar.php/foo/hi on line %d +Warning: file_get_contents(): Failed to open stream: phar error: path "oops" is a directory in phar://%sfgc_edgecases.phar.php/foo/hi on line %d Warning: file_get_contents(): Failed to seek to position 50000 in the stream in phar://%sfgc_edgecases.phar.php/foo/hi on line %d --EXPECTF-- hihi -Warning: fopen(notfound.txt): Failed to open stream: No such file or directory in phar://%sfopen.phar.php/index.php on line %d +Warning: fopen(): Failed to open stream: No such file or directory in phar://%sfopen.phar.php/index.php on line %d diff --git a/ext/phar/tests/fopen_edgecases.phpt b/ext/phar/tests/fopen_edgecases.phpt index 12b4ecde7589..5c8e6c87dfb2 100644 --- a/ext/phar/tests/fopen_edgecases.phpt +++ b/ext/phar/tests/fopen_edgecases.phpt @@ -71,16 +71,16 @@ include $pname . '/test.php'; --EXPECTF-- -Warning: fopen(phar://%sfopen_edgecases.phar.php/b/c.php): Failed to open stream: phar error: open mode append not supported in %sfopen_edgecases.php on line %d +Warning: fopen(): Failed to open stream: phar error: open mode append not supported in %sfopen_edgecases.php on line %d -Warning: fopen(phar://%sfopen_edgecases.phar.php.phar.gz): Failed to open stream: phar error: invalid url or non-existent phar "phar://%sfopen_edgecases.phar.php.phar.gz" in %sfopen_edgecases.php on line %d +Warning: fopen(): Failed to open stream: phar error: invalid url or non-existent phar "phar://%sfopen_edgecases.phar.php.phar.gz" in %sfopen_edgecases.php on line %d bool(false) -Warning: fopen(phar://%sfopen_edgecases.2.phar.php/hi): Failed to open stream: internal corruption of phar "%sfopen_edgecases.2.phar.php" (truncated manifest at stub end) in %sfopen_edgecases.php on line %d +Warning: fopen(): Failed to open stream: internal corruption of phar "%sfopen_edgecases.2.phar.php" (truncated manifest at stub end) in %sfopen_edgecases.php on line %d -Warning: fopen(phar://): Failed to open stream: phar error: no directory in "phar://", must have at least phar:/// for root directory (always use full path to a new phar) in %sfopen_edgecases.php on line %d +Warning: fopen(): Failed to open stream: phar error: no directory in "phar://", must have at least phar:/// for root directory (always use full path to a new phar) in %sfopen_edgecases.php on line %d -Warning: fopen(phar://foo.phar): Failed to open stream: %s in %sfopen_edgecases.php on line %d +Warning: fopen(): Failed to open stream: %s in %sfopen_edgecases.php on line %d int(0) int(1) int(0) @@ -118,5 +118,5 @@ Warning: rename(): phar error: cannot rename "phar://%sfopen_edgecases.phar.php/ Warning: rename(): phar error: cannot rename "phar://%sfopen_edgecases.phar.php/hi" to "phar://%sfopen_edgecases.phar.php/there": invalid or non-writable url "phar://%sfopen_edgecases.phar.php/hi" in %sfopen_edgecases.php on line %d -Warning: fopen(./notfound.php): Failed to open stream: No such file or directory in phar://%sfopen_edgecases.phar.php/test.php on line %d +Warning: fopen(): Failed to open stream: No such file or directory in phar://%sfopen_edgecases.phar.php/test.php on line %d diff --git a/ext/phar/tests/fopen_edgecases2.phpt b/ext/phar/tests/fopen_edgecases2.phpt index 6fae07c0fda4..697ce81cf339 100644 --- a/ext/phar/tests/fopen_edgecases2.phpt +++ b/ext/phar/tests/fopen_edgecases2.phpt @@ -41,4 +41,4 @@ fopen(): Argument #1 ($filename) must be of type string, array given blah test -Warning: fopen(phar://%sfopen_edgecases2.phar.php/oops): Failed to open stream: phar error: path "oops" is a directory in phar://%sfopen_edgecases2.phar.php/foo/hi on line %d +Warning: fopen(): Failed to open stream: phar error: path "oops" is a directory in phar://%sfopen_edgecases2.phar.php/foo/hi on line %d diff --git a/ext/phar/tests/frontcontroller22.phpt b/ext/phar/tests/frontcontroller22.phpt index 5fb9490e2dca..431e8991ce64 100644 --- a/ext/phar/tests/frontcontroller22.phpt +++ b/ext/phar/tests/frontcontroller22.phpt @@ -16,6 +16,6 @@ Content-type: text/html; charset=UTF-8 string(4) "test" string(12) "oof/test.php" -Warning: include(./hi.php): Failed to open stream: No such file or directory in phar://%s/oof/test.php on line %d +Warning: include(): Failed to open stream: No such file or directory in phar://%s/oof/test.php on line %d Warning: include(): Failed opening './hi.php' for inclusion (include_path='%s') in phar://%soof/test.php on line %d diff --git a/ext/phar/tests/include_path.phpt b/ext/phar/tests/include_path.phpt index 0f2dd585904e..a7fe9a468877 100644 --- a/ext/phar/tests/include_path.phpt +++ b/ext/phar/tests/include_path.phpt @@ -29,6 +29,6 @@ include 'file2.php'; file1.php test/file1.php -Warning: include(file2.php): Failed to open stream: No such file or directory in %sinclude_path.php on line %d +Warning: include(): Failed to open stream: No such file or directory in %sinclude_path.php on line %d Warning: include(): Failed opening 'file2.php' for inclusion (include_path='%sphar://%stempmanifest1.phar.php/test') in %sinclude_path.php on line %d diff --git a/ext/phar/tests/mounteddir.phpt b/ext/phar/tests/mounteddir.phpt index 2f6be58eb4d4..e9f9bbec4689 100644 --- a/ext/phar/tests/mounteddir.phpt +++ b/ext/phar/tests/mounteddir.phpt @@ -95,7 +95,7 @@ string(%d) "%sextfile.php" var_dump(__FILE__); ?> -Warning: file_get_contents(phar://%stempmanifest1.phar.php/testit/directory): Failed to open stream: phar error: path "testit/directory" is a directory in phar://%stempmanifest1.phar.php/index.php on line %d +Warning: file_get_contents(): Failed to open stream: phar error: path "testit/directory" is a directory in phar://%stempmanifest1.phar.php/index.php on line %d oops string(%d) "phar://%sextfile.php" diff --git a/ext/phar/tests/open_for_write_existing_b.phpt b/ext/phar/tests/open_for_write_existing_b.phpt index c11fb9a67f12..e590e68919cc 100644 --- a/ext/phar/tests/open_for_write_existing_b.phpt +++ b/ext/phar/tests/open_for_write_existing_b.phpt @@ -23,6 +23,6 @@ include $pname . '/b/c.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_existing_b.phar.php/b/c.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d bool(false) This is b/c diff --git a/ext/phar/tests/open_for_write_existing_c.phpt b/ext/phar/tests/open_for_write_existing_c.phpt index e8867d83b461..56fdccee0679 100644 --- a/ext/phar/tests/open_for_write_existing_c.phpt +++ b/ext/phar/tests/open_for_write_existing_c.phpt @@ -23,6 +23,6 @@ include $pname . '/b/c.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_existing_c.phar.php/b/c.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d bool(false) This is b/c diff --git a/ext/phar/tests/open_for_write_newfile_b.phpt b/ext/phar/tests/open_for_write_newfile_b.phpt index 498e3dd4be3e..76248ceeb6f4 100644 --- a/ext/phar/tests/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/open_for_write_newfile_b.phpt @@ -25,11 +25,11 @@ include $pname . '/b/new.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d bool(false) This is b/c -Warning: include(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d +Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d diff --git a/ext/phar/tests/open_for_write_newfile_c.phpt b/ext/phar/tests/open_for_write_newfile_c.phpt index 8bb0e2ba6803..9a940823dd36 100644 --- a/ext/phar/tests/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/open_for_write_newfile_c.phpt @@ -25,11 +25,11 @@ include $pname . '/b/new.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d bool(false) This is b/c -Warning: include(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d +Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d diff --git a/ext/phar/tests/opendir.phpt b/ext/phar/tests/opendir.phpt index 77a17c80f221..a11c50e00015 100644 --- a/ext/phar/tests/opendir.phpt +++ b/ext/phar/tests/opendir.phpt @@ -35,8 +35,8 @@ opendir('phar://hi.phar'); --EXPECTF-- file1.txtfile2.txtfile3.txt -Warning: opendir(phar://): Failed to open directory: phar error: no directory in "phar://", must have at least phar:/// for root directory (always use full path to a new phar) +Warning: opendir(): Failed to open directory: phar error: no directory in "phar://", must have at least phar:/// for root directory (always use full path to a new phar) phar url "phar://" is unknown in %sopendir.php on line %d -Warning: opendir(phar://hi.phar): Failed to open directory: phar error: invalid url or non-existent phar "phar://hi.phar" +Warning: opendir(): Failed to open directory: phar error: invalid url or non-existent phar "phar://hi.phar" phar url "phar://hi.phar" is unknown in %sopendir.php on line %d diff --git a/ext/phar/tests/opendir_edgecases.phpt b/ext/phar/tests/opendir_edgecases.phpt index fbca644d18db..4d35f0655c92 100644 --- a/ext/phar/tests/opendir_edgecases.phpt +++ b/ext/phar/tests/opendir_edgecases.phpt @@ -60,4 +60,4 @@ opendir(): Argument #1 ($directory) must be of type string, array given .. foo -Warning: opendir(phar://%sopendir_edgecases.phar.php/oops): Failed to open directory: %s in phar://%sopendir_edgecases.phar.php/foo on line %d +Warning: opendir(): Failed to open directory: %s in phar://%sopendir_edgecases.phar.php/foo on line %d diff --git a/ext/phar/tests/phar_buildfromdirectory2-win.phpt b/ext/phar/tests/phar_buildfromdirectory2-win.phpt index e2d51b2c4664..6a41caf03883 100644 --- a/ext/phar/tests/phar_buildfromdirectory2-win.phpt +++ b/ext/phar/tests/phar_buildfromdirectory2-win.phpt @@ -21,4 +21,4 @@ try { ?> --EXPECT-- string(24) "UnexpectedValueException" -RecursiveDirectoryIterator::__construct(1): Failed to open directory: No such file or directory +RecursiveDirectoryIterator::__construct(): Failed to open directory: No such file or directory diff --git a/ext/phar/tests/phar_buildfromdirectory2.phpt b/ext/phar/tests/phar_buildfromdirectory2.phpt index c828587548a9..b5f14671dbfc 100644 --- a/ext/phar/tests/phar_buildfromdirectory2.phpt +++ b/ext/phar/tests/phar_buildfromdirectory2.phpt @@ -21,4 +21,4 @@ try { ?> --EXPECTF-- %s(24) "UnexpectedValueException" -RecursiveDirectoryIterator::__construct(1): Failed to open directory: No such file or directory +RecursiveDirectoryIterator::__construct(): Failed to open directory: No such file or directory diff --git a/ext/phar/tests/phar_gobyebye-win32.phpt b/ext/phar/tests/phar_gobyebye-win32.phpt index 8100e6cf3000..552fab406e78 100644 --- a/ext/phar/tests/phar_gobyebye-win32.phpt +++ b/ext/phar/tests/phar_gobyebye-win32.phpt @@ -31,11 +31,11 @@ include $pname . '/foo/hi'; unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.php'); ?> --EXPECTF-- -Warning: readfile(foo/hi): Failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d +Warning: readfile(): Failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d -Warning: fopen(foo/hi): Failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d +Warning: fopen(): Failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d -Warning: file_get_contents(foo/hi): Failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d Warning: stat(): stat failed for foo/hi in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d bool(false) @@ -44,4 +44,4 @@ bool(false) bool(false) bool(false) -Warning: opendir(foo/hi): Failed to open directory: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d +Warning: opendir(): Failed to open directory: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d diff --git a/ext/phar/tests/phar_gobyebye.phpt b/ext/phar/tests/phar_gobyebye.phpt index 4db6e0d91cdc..a42757936d7a 100644 --- a/ext/phar/tests/phar_gobyebye.phpt +++ b/ext/phar/tests/phar_gobyebye.phpt @@ -32,11 +32,11 @@ include $pname . '/foo/hi'; unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.php'); ?> --EXPECTF-- -Warning: readfile(foo/hi): Failed to open stream: No such file or directory in phar://%sphar_gobyebye.phar.php/foo/hi on line %d +Warning: readfile(): Failed to open stream: No such file or directory in phar://%sphar_gobyebye.phar.php/foo/hi on line %d -Warning: fopen(foo/hi): Failed to open stream: No such file or directory in phar://%sphar_gobyebye.phar.php/foo/hi on line %d +Warning: fopen(): Failed to open stream: No such file or directory in phar://%sphar_gobyebye.phar.php/foo/hi on line %d -Warning: file_get_contents(foo/hi): Failed to open stream: No such file or directory in phar://%sphar_gobyebye.phar.php/foo/hi on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in phar://%sphar_gobyebye.phar.php/foo/hi on line %d Warning: stat(): stat failed for foo/hi in phar://%sphar_gobyebye.phar.php/foo/hi on line %d bool(false) @@ -45,4 +45,4 @@ bool(false) bool(false) bool(false) -Warning: opendir(foo/hi): Failed to open directory: No such file or directory in phar://%sphar_gobyebye.phar.php/foo/hi on line %d +Warning: opendir(): Failed to open directory: No such file or directory in phar://%sphar_gobyebye.phar.php/foo/hi on line %d diff --git a/ext/phar/tests/readfile_edgecases.phpt b/ext/phar/tests/readfile_edgecases.phpt index c4de84eefe3c..781016051302 100644 --- a/ext/phar/tests/readfile_edgecases.phpt +++ b/ext/phar/tests/readfile_edgecases.phpt @@ -54,4 +54,4 @@ readfile("./hi", 0, $context); readfile("../oops"); ?> -Warning: readfile(phar://%sreadfile_edgecases.phar.php/oops): Failed to open stream: phar error: path "oops" is a directory in phar://%sreadfile_edgecases.phar.php/foo/hi on line %d +Warning: readfile(): Failed to open stream: phar error: path "oops" is a directory in phar://%sreadfile_edgecases.phar.php/foo/hi on line %d diff --git a/ext/phar/tests/rename.phpt b/ext/phar/tests/rename.phpt index 1793d34834d2..ea0d28446c02 100644 --- a/ext/phar/tests/rename.phpt +++ b/ext/phar/tests/rename.phpt @@ -29,4 +29,4 @@ echo file_get_contents($pname . '/a') . "\n"; a a -Warning: file_get_contents(phar://%srename.phar.php/a): Failed to open stream: phar error: "a" is not a file in phar "%srename.phar.php" in %srename.php on line %d +Warning: file_get_contents(): Failed to open stream: phar error: "a" is not a file in phar "%srename.phar.php" in %srename.php on line %d diff --git a/ext/phar/tests/rename_dir.phpt b/ext/phar/tests/rename_dir.phpt index bbba70137fb3..7bf59e1f1d9c 100644 --- a/ext/phar/tests/rename_dir.phpt +++ b/ext/phar/tests/rename_dir.phpt @@ -30,4 +30,4 @@ echo file_get_contents($pname . '/a/x') . "\n"; a a -Warning: file_get_contents(phar://%srename_dir.phar.php/a/x): Failed to open stream: phar error: "a/x" is not a file in phar "%srename_dir.phar.php" in %srename_dir.php on line %d +Warning: file_get_contents(): Failed to open stream: phar error: "a/x" is not a file in phar "%srename_dir.phar.php" in %srename_dir.php on line %d diff --git a/ext/phar/tests/tar/create_new_phar_b.phpt b/ext/phar/tests/tar/create_new_phar_b.phpt index 7ec06f42931c..2c09c0470cd6 100644 --- a/ext/phar/tests/tar/create_new_phar_b.phpt +++ b/ext/phar/tests/tar/create_new_phar_b.phpt @@ -13,9 +13,9 @@ file_put_contents('phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.pha include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.tar/a.php'; ?> --EXPECTF-- -Warning: file_put_contents(phar://%screate_new_phar_b.phar.tar/a.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %screate_new_phar_b.php on line %d +Warning: file_put_contents(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %screate_new_phar_b.php on line %d -Warning: include(phar://%screate_new_phar_b.phar.tar/a.php): Failed to open stream: %s in %screate_new_phar_b.php on line %d +Warning: include(): Failed to open stream: %s in %screate_new_phar_b.php on line %d Warning: include(): Failed opening 'phar://%screate_new_phar_b.phar.tar/a.php' for inclusion (include_path='%s') in %screate_new_phar_b.php on line %d diff --git a/ext/phar/tests/tar/delete.phpt b/ext/phar/tests/tar/delete.phpt index eab91d5a0e13..2a6a8f57667f 100644 --- a/ext/phar/tests/tar/delete.phpt +++ b/ext/phar/tests/tar/delete.phpt @@ -29,4 +29,4 @@ echo file_get_contents($alias . '/a') . "\n"; --EXPECTF-- a -Warning: file_get_contents(phar://%sdelete.phar.tar/a): Failed to open stream: phar error: "a" is not a file in phar "%sdelete.phar.tar" in %sdelete.php on line %d +Warning: file_get_contents(): Failed to open stream: phar error: "a" is not a file in phar "%sdelete.phar.tar" in %sdelete.php on line %d diff --git a/ext/phar/tests/tar/delete_in_phar.phpt b/ext/phar/tests/tar/delete_in_phar.phpt index b9f624c728da..79aeeba0d0f3 100644 --- a/ext/phar/tests/tar/delete_in_phar.phpt +++ b/ext/phar/tests/tar/delete_in_phar.phpt @@ -42,7 +42,7 @@ This is b/c This is a This is b -Warning: include(%sdelete_in_phar.phar.tar/b/c.php): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.tar" in %sdelete_in_phar.php on line %d +Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.tar" in %sdelete_in_phar.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.tar/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d diff --git a/ext/phar/tests/tar/delete_in_phar_confirm.phpt b/ext/phar/tests/tar/delete_in_phar_confirm.phpt index 4a952a4b9f1b..cdd08441e86c 100644 --- a/ext/phar/tests/tar/delete_in_phar_confirm.phpt +++ b/ext/phar/tests/tar/delete_in_phar_confirm.phpt @@ -45,7 +45,7 @@ This is b/c This is a This is b -Warning: include(%sdelete_in_phar_confirm.phar.tar/b/c.php): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.tar" in %sdelete_in_phar_confirm.php on line %d +Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.tar" in %sdelete_in_phar_confirm.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.tar/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d diff --git a/ext/phar/tests/tar/gh16695_1.phpt b/ext/phar/tests/tar/gh16695_1.phpt index 8ce82bcf28dd..8613c77658d6 100644 --- a/ext/phar/tests/tar/gh16695_1.phpt +++ b/ext/phar/tests/tar/gh16695_1.phpt @@ -24,5 +24,5 @@ var_dump($buffer); --EXPECTF-- int(512) -Warning: file_get_contents(%stls): Failed to open stream: phar error: path "tls" is a directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: phar error: path "tls" is a directory in %s on line %d bool(false) diff --git a/ext/phar/tests/tar/open_for_write_existing_b.phpt b/ext/phar/tests/tar/open_for_write_existing_b.phpt index ce400ab687ff..b8afb8b21c02 100644 --- a/ext/phar/tests/tar/open_for_write_existing_b.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_b.phpt @@ -36,7 +36,7 @@ include $alias . '/b/c.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_existing_b.phar.tar/b/c.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d bool(false) This is b/c diff --git a/ext/phar/tests/tar/open_for_write_existing_c.phpt b/ext/phar/tests/tar/open_for_write_existing_c.phpt index 0d251944b9f4..0cba841f2d86 100644 --- a/ext/phar/tests/tar/open_for_write_existing_c.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_c.phpt @@ -36,7 +36,7 @@ include $alias . '/b/c.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_existing_c.phar.tar/b/c.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d bool(false) This is b/c diff --git a/ext/phar/tests/tar/open_for_write_newfile_b.phpt b/ext/phar/tests/tar/open_for_write_newfile_b.phpt index c4192f2a8623..794d02d8acf4 100644 --- a/ext/phar/tests/tar/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_b.phpt @@ -37,11 +37,11 @@ include $alias . '/b/new.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_newfile_b.phar.tar/b/new.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d bool(false) This is b/c -Warning: include(phar://%sopen_for_write_newfile_b.phar.tar/b/new.php): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.tar" in %sopen_for_write_newfile_b.php on line %d +Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.tar" in %sopen_for_write_newfile_b.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.tar/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d diff --git a/ext/phar/tests/tar/open_for_write_newfile_c.phpt b/ext/phar/tests/tar/open_for_write_newfile_c.phpt index 89887823cc26..13c80ec857ae 100644 --- a/ext/phar/tests/tar/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_c.phpt @@ -36,11 +36,11 @@ include $alias . '/b/new.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_newfile_c.phar.tar/b/new.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d bool(false) This is b/c -Warning: include(phar://%sopen_for_write_newfile_c.phar.tar/b/new.php): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.tar" in %sopen_for_write_newfile_c.php on line %d +Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.tar" in %sopen_for_write_newfile_c.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.tar/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d diff --git a/ext/phar/tests/tar/rename.phpt b/ext/phar/tests/tar/rename.phpt index b80362bd33fb..7173697c46d3 100644 --- a/ext/phar/tests/tar/rename.phpt +++ b/ext/phar/tests/tar/rename.phpt @@ -39,4 +39,4 @@ echo file_get_contents($alias . '/a') . "\n"; a a -Warning: file_get_contents(phar://%srename.phar.tar/a): Failed to open stream: phar error: "a" is not a file in phar "%srename.phar.tar" in %srename.php on line %d +Warning: file_get_contents(): Failed to open stream: phar error: "a" is not a file in phar "%srename.phar.tar" in %srename.php on line %d diff --git a/ext/phar/tests/tar/rename_dir.phpt b/ext/phar/tests/tar/rename_dir.phpt index e043cf236a84..205f7d0bd82e 100644 --- a/ext/phar/tests/tar/rename_dir.phpt +++ b/ext/phar/tests/tar/rename_dir.phpt @@ -39,4 +39,4 @@ echo file_get_contents($alias . '/a/x') . "\n"; a a -Warning: file_get_contents(phar://%srename_dir.phar.tar/a/x): Failed to open stream: phar error: "a/x" is not a file in phar "%srename_dir.phar.tar" in %srename_dir.php on line %d +Warning: file_get_contents(): Failed to open stream: phar error: "a/x" is not a file in phar "%srename_dir.phar.tar" in %srename_dir.php on line %d diff --git a/ext/phar/tests/tar/tar_001.phpt b/ext/phar/tests/tar/tar_001.phpt index 55b56c0469ae..2ddeae188e41 100644 --- a/ext/phar/tests/tar/tar_001.phpt +++ b/ext/phar/tests/tar/tar_001.phpt @@ -24,5 +24,5 @@ try { @unlink(__DIR__ . '/tar_001.phar.tar'); ?> --EXPECTF-- -Warning: fopen(phar://%star_001.phar.tar/tar_001.phpt): Failed to open stream: phar error: "%star_001.phar.tar" is a corrupted tar file (truncated) in %star_001.php on line 9 +Warning: fopen(): Failed to open stream: phar error: "%star_001.phar.tar" is a corrupted tar file (truncated) in %star_001.php on line 9 phar error: "%star_001.phar.tar" is a corrupted tar file (truncated) diff --git a/ext/phar/tests/tar/tar_002.phpt b/ext/phar/tests/tar/tar_002.phpt index 75bbe91d8c37..12c7ec3bbccc 100644 --- a/ext/phar/tests/tar/tar_002.phpt +++ b/ext/phar/tests/tar/tar_002.phpt @@ -27,5 +27,5 @@ try { @unlink(__DIR__ . '/tar_002.phar.tar'); ?> --EXPECTF-- -Warning: fopen(phar://%star_002.phar.tar/tar_002.phpt): Failed to open stream: phar error: "%star_002.phar.tar" is a corrupted tar file (truncated) in %star_002.php on line 9 +Warning: fopen(): Failed to open stream: phar error: "%star_002.phar.tar" is a corrupted tar file (truncated) in %star_002.php on line 9 phar error: "%star_002.phar.tar" is a corrupted tar file (truncated) diff --git a/ext/phar/tests/tar/tar_nostub.phpt b/ext/phar/tests/tar/tar_nostub.phpt index 061fa6c8f5ef..708354f82dca 100644 --- a/ext/phar/tests/tar/tar_nostub.phpt +++ b/ext/phar/tests/tar/tar_nostub.phpt @@ -41,6 +41,6 @@ try { @unlink(__DIR__ . '/tar_nostub.tar'); ?> --EXPECTF-- -RecursiveDirectoryIterator::__construct(phar://%star_nostub.phar.tar/): Failed to open directory: '%star_nostub.phar.tar' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive +RecursiveDirectoryIterator::__construct(): Failed to open directory: '%star_nostub.phar.tar' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive phar url "phar://%star_nostub.phar.tar/" is unknown string(0) "" diff --git a/ext/phar/tests/test_alias_unset.phpt b/ext/phar/tests/test_alias_unset.phpt index 3a11fbac6d5a..0b332514a34b 100644 --- a/ext/phar/tests/test_alias_unset.phpt +++ b/ext/phar/tests/test_alias_unset.phpt @@ -40,4 +40,4 @@ $a = file_get_contents($pname . '/file1.txt'); // this fails because $fname2 ref Cannot open archive "%stest_alias_unset.2.phar.php", alias is already in use by existing archive string(5) "first" -Warning: file_get_contents(phar://%sfile1.txt): Failed to open stream: Cannot open archive "%stest_alias_unset.phar.php", alias is already in use by existing archive in %stest_alias_unset.php on line %d +Warning: file_get_contents(): Failed to open stream: Cannot open archive "%stest_alias_unset.phar.php", alias is already in use by existing archive in %stest_alias_unset.php on line %d diff --git a/ext/phar/tests/zip/create_new_phar_b.phpt b/ext/phar/tests/zip/create_new_phar_b.phpt index 0f4e239f91de..c976a3a2dde0 100644 --- a/ext/phar/tests/zip/create_new_phar_b.phpt +++ b/ext/phar/tests/zip/create_new_phar_b.phpt @@ -13,9 +13,9 @@ file_put_contents('phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.pha include 'phar://' . __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.zip/a.php'; ?> --EXPECTF-- -Warning: file_put_contents(phar://%screate_new_phar_b.phar.zip/a.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %screate_new_phar_b.php on line %d +Warning: file_put_contents(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %screate_new_phar_b.php on line %d -Warning: include(phar://%screate_new_phar_b.phar.zip/a.php): Failed to open stream: %s in %screate_new_phar_b.php on line %d +Warning: include(): Failed to open stream: %s in %screate_new_phar_b.php on line %d Warning: include(): Failed opening 'phar://%screate_new_phar_b.phar.zip/a.php' for inclusion (include_path='%s') in %screate_new_phar_b.php on line %d diff --git a/ext/phar/tests/zip/delete.phpt b/ext/phar/tests/zip/delete.phpt index 7453445f2249..9247a70ea067 100644 --- a/ext/phar/tests/zip/delete.phpt +++ b/ext/phar/tests/zip/delete.phpt @@ -28,4 +28,4 @@ echo file_get_contents($alias . '/a') . "\n"; --EXPECTF-- a -Warning: file_get_contents(phar://%sdelete.phar.zip/a): Failed to open stream: phar error: "a" is not a file in phar "%sdelete.phar.zip" in %sdelete.php on line %d +Warning: file_get_contents(): Failed to open stream: phar error: "a" is not a file in phar "%sdelete.phar.zip" in %sdelete.php on line %d diff --git a/ext/phar/tests/zip/delete_in_phar.phpt b/ext/phar/tests/zip/delete_in_phar.phpt index b07f0bdbd8bd..8ebdd95cd2de 100644 --- a/ext/phar/tests/zip/delete_in_phar.phpt +++ b/ext/phar/tests/zip/delete_in_phar.phpt @@ -41,7 +41,7 @@ This is b/c This is a This is b -Warning: include(%sdelete_in_phar.phar.zip/b/c.php): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.zip" in %sdelete_in_phar.php on line %d +Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.zip" in %sdelete_in_phar.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.zip/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d diff --git a/ext/phar/tests/zip/delete_in_phar_confirm.phpt b/ext/phar/tests/zip/delete_in_phar_confirm.phpt index f5f65c8ede87..14a2a78b62e0 100644 --- a/ext/phar/tests/zip/delete_in_phar_confirm.phpt +++ b/ext/phar/tests/zip/delete_in_phar_confirm.phpt @@ -46,7 +46,7 @@ This is b/c This is a This is b -Warning: include(%sdelete_in_phar_confirm.phar.zip/b/c.php): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.zip" in %sdelete_in_phar_confirm.php on line %d +Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.zip" in %sdelete_in_phar_confirm.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.zip/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d diff --git a/ext/phar/tests/zip/notphar.phpt b/ext/phar/tests/zip/notphar.phpt index ab4f80e430bb..31e8b3f7bb5d 100644 --- a/ext/phar/tests/zip/notphar.phpt +++ b/ext/phar/tests/zip/notphar.phpt @@ -20,5 +20,5 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); __HALT_COMPILER(); ?> --EXPECTF-- -Warning: include(phar://%snotphar.phar.zip/.phar/stub.php): Failed to open stream: '%snotphar.phar.zip' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive in %snotphar.php on line %d +Warning: include(): Failed to open stream: '%snotphar.phar.zip' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive in %snotphar.php on line %d PK%a diff --git a/ext/phar/tests/zip/open_for_write_existing_b.phpt b/ext/phar/tests/zip/open_for_write_existing_b.phpt index 9383f3bfe5e5..cc8d07e549b6 100644 --- a/ext/phar/tests/zip/open_for_write_existing_b.phpt +++ b/ext/phar/tests/zip/open_for_write_existing_b.phpt @@ -33,6 +33,6 @@ include $alias . '/b/c.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_existing_b.phar.zip/b/c.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d bool(false) This is b/c diff --git a/ext/phar/tests/zip/open_for_write_existing_c.phpt b/ext/phar/tests/zip/open_for_write_existing_c.phpt index 2e972c112f31..b99f76523457 100644 --- a/ext/phar/tests/zip/open_for_write_existing_c.phpt +++ b/ext/phar/tests/zip/open_for_write_existing_c.phpt @@ -33,6 +33,6 @@ include $alias . '/b/c.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_existing_c.phar.zip/b/c.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d bool(false) This is b/c diff --git a/ext/phar/tests/zip/open_for_write_newfile_b.phpt b/ext/phar/tests/zip/open_for_write_newfile_b.phpt index c70968809b56..4ca15e58c29d 100644 --- a/ext/phar/tests/zip/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_b.phpt @@ -36,11 +36,11 @@ include $alias . '/b/new.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_newfile_b.phar.zip/b/new.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_b.php on line %d bool(false) This is b/c -Warning: include(phar://%sopen_for_write_newfile_b.phar.zip/b/new.php): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.zip" in %sopen_for_write_newfile_b.php on line %d +Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.zip" in %sopen_for_write_newfile_b.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.zip/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d diff --git a/ext/phar/tests/zip/open_for_write_newfile_c.phpt b/ext/phar/tests/zip/open_for_write_newfile_c.phpt index fbfe2104c84e..89a380d345a9 100644 --- a/ext/phar/tests/zip/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_c.phpt @@ -36,11 +36,11 @@ include $alias . '/b/new.php'; --CLEAN-- --EXPECTF-- -Warning: fopen(phar://%sopen_for_write_newfile_c.phar.zip/b/new.php): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d +Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_newfile_c.php on line %d bool(false) This is b/c -Warning: include(phar://%sopen_for_write_newfile_c.phar.zip/b/new.php): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.zip" in %sopen_for_write_newfile_c.php on line %d +Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.zip" in %sopen_for_write_newfile_c.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.zip/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d diff --git a/ext/phar/tests/zip/rename.phpt b/ext/phar/tests/zip/rename.phpt index 209a6b4ac475..362f0c04d00e 100644 --- a/ext/phar/tests/zip/rename.phpt +++ b/ext/phar/tests/zip/rename.phpt @@ -31,4 +31,4 @@ echo file_get_contents($alias . '/a') . "\n"; a a -Warning: file_get_contents(phar://%srename.phar.zip/a): Failed to open stream: phar error: "a" is not a file in phar "%srename.phar.zip" in %srename.php on line %d +Warning: file_get_contents(): Failed to open stream: phar error: "a" is not a file in phar "%srename.phar.zip" in %srename.php on line %d diff --git a/ext/phar/tests/zip/rename_dir.phpt b/ext/phar/tests/zip/rename_dir.phpt index 76d07734e5b9..e8a26f153841 100644 --- a/ext/phar/tests/zip/rename_dir.phpt +++ b/ext/phar/tests/zip/rename_dir.phpt @@ -31,4 +31,4 @@ echo file_get_contents($alias . '/a/x') . "\n"; a a -Warning: file_get_contents(phar://%srename_dir.phar.zip/a/x): Failed to open stream: phar error: "a/x" is not a file in phar "%srename_dir.phar.zip" in %srename_dir.php on line %d +Warning: file_get_contents(): Failed to open stream: phar error: "a/x" is not a file in phar "%srename_dir.phar.zip" in %srename_dir.php on line %d diff --git a/ext/standard/tests/dir/bug80960.phpt b/ext/standard/tests/dir/bug80960.phpt index 33fcaf9fe287..e52a4a719995 100644 --- a/ext/standard/tests/dir/bug80960.phpt +++ b/ext/standard/tests/dir/bug80960.phpt @@ -11,8 +11,8 @@ opendir("notexist?"); opendir(str_pad("longname", PHP_MAXPATHLEN - strlen(getcwd()), "_")); ?> --EXPECTF-- -Warning: opendir(notexist*): Failed to open directory: No such file or directory in %s on line %d +Warning: opendir(): Failed to open directory: No such file or directory in %s on line %d -Warning: opendir(notexist?): Failed to open directory: No such file or directory in %s on line %d +Warning: opendir(): Failed to open directory: No such file or directory in %s on line %d -Warning: opendir(longname%r_+%r): Failed to open directory: Filename too long in %s on line %d +Warning: opendir(): Failed to open directory: Filename too long in %s on line %d diff --git a/ext/standard/tests/dir/dir_variation5.phpt b/ext/standard/tests/dir/dir_variation5.phpt index 41a29760eb05..841257a79c42 100644 --- a/ext/standard/tests/dir/dir_variation5.phpt +++ b/ext/standard/tests/dir/dir_variation5.phpt @@ -24,6 +24,6 @@ echo "Done"; --EXPECTF-- *** Testing dir() : open a file instead of a directory *** -Warning: dir(%s): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Done diff --git a/ext/standard/tests/dir/dir_variation6.phpt b/ext/standard/tests/dir/dir_variation6.phpt index 0f9c14b91d47..aa0a9aa3a4c4 100644 --- a/ext/standard/tests/dir/dir_variation6.phpt +++ b/ext/standard/tests/dir/dir_variation6.phpt @@ -42,10 +42,10 @@ echo "Done"; *** Testing dir() : open a non-existent directory *** -- opening previously removed directory -- -Warning: dir(%s): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) -- opening non-existent directory -- -Warning: dir(%s): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Done diff --git a/ext/standard/tests/dir/dir_variation7.phpt b/ext/standard/tests/dir/dir_variation7.phpt index 2b245fd612a8..b09f6ed82659 100644 --- a/ext/standard/tests/dir/dir_variation7.phpt +++ b/ext/standard/tests/dir/dir_variation7.phpt @@ -71,10 +71,10 @@ rmdir($parent_dir_path); *** Testing dir() : remove execute permission from the parent dir *** -- After restricting 1st level parent directory -- -Warning: dir(%s/dir_variation7/sub_dir/child_dir): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) -- After restricting parent directory -- -Warning: dir(%s/dir_variation7/sub_dir/child_dir): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Done diff --git a/ext/standard/tests/dir/dir_variation8.phpt b/ext/standard/tests/dir/dir_variation8.phpt index 38d60a039052..f2855b08c695 100644 --- a/ext/standard/tests/dir/dir_variation8.phpt +++ b/ext/standard/tests/dir/dir_variation8.phpt @@ -39,16 +39,16 @@ echo "Done"; *** Testing dir() : checking with wildcard characters *** -- wildcard = '*' -- -Warning: dir(%s/dir_var*): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) -Warning: dir(%s/*): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) -- wildcard = '?' -- -Warning: dir(%s/dir_variation81/sub_dir?): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) -Warning: dir(%s/dir_variation81/sub?dir1): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Done diff --git a/ext/standard/tests/dir/dir_variation9.phpt b/ext/standard/tests/dir/dir_variation9.phpt index 88ea69cb3df3..aafcba6dd7a7 100644 --- a/ext/standard/tests/dir/dir_variation9.phpt +++ b/ext/standard/tests/dir/dir_variation9.phpt @@ -97,15 +97,15 @@ object(Directory)#%d (2) { -- With invalid paths -- -Warning: dir(%s/dir_variation91/sub_dir12/sub_dir111/..): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) -Warning: dir(%s/dir_variation92/sub_dir21/../dir_variation91): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) -Warning: dir(%s/dir_variation92/sub_dir21/../../dir_variation91/sub_dir12/..): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) -Warning: dir(%s/dir_variation91/sub_dir11/sub_dir111/../../dir_variation92/sub_dir21/..): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Done diff --git a/ext/standard/tests/dir/opendir_error2.phpt b/ext/standard/tests/dir/opendir_error2.phpt index 32371f917829..5c077bc431f0 100644 --- a/ext/standard/tests/dir/opendir_error2.phpt +++ b/ext/standard/tests/dir/opendir_error2.phpt @@ -27,10 +27,10 @@ var_dump(opendir('idonotexist')); -- Pass a non-existent absolute path: -- -Warning: opendir(%s/idonotexist): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) -- Pass a non-existent relative path: -- -Warning: opendir(idonotexist): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) diff --git a/ext/standard/tests/dir/opendir_variation5.phpt b/ext/standard/tests/dir/opendir_variation5.phpt index f6b2934474b8..856c6998ac46 100644 --- a/ext/standard/tests/dir/opendir_variation5.phpt +++ b/ext/standard/tests/dir/opendir_variation5.phpt @@ -78,10 +78,10 @@ rmdir($parent_dir_path); -- After restricting 1st level parent directory -- -Warning: opendir(%s/opendir_variation5/sub_dir/child_dir): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) -- After restricting parent directory -- -Warning: opendir(%s/opendir_variation5/sub_dir/child_dir): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) diff --git a/ext/standard/tests/dir/opendir_variation6-win32.phpt b/ext/standard/tests/dir/opendir_variation6-win32.phpt index e2cd97f4e05e..92d1d22ca3f6 100644 --- a/ext/standard/tests/dir/opendir_variation6-win32.phpt +++ b/ext/standard/tests/dir/opendir_variation6-win32.phpt @@ -45,16 +45,16 @@ rmdir($dir_path); -- Wildcard = '*' -- -Warning: opendir(%s/opendir_var*): %s in %s on line %d +Warning: opendir(): %s in %s on line %d bool(false) -Warning: opendir(%s/*): %s in %s on line %d +Warning: opendir(): %s in %s on line %d bool(false) -- Wildcard = '?' -- -Warning: opendir(%s/opendir_variation6/sub_dir?): %s in %s on line %d +Warning: opendir(): %s in %s on line %d bool(false) -Warning: opendir(%s/opendir_variation6/sub?dir1): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) diff --git a/ext/standard/tests/dir/opendir_variation6.phpt b/ext/standard/tests/dir/opendir_variation6.phpt index 7e3046f9af8e..69c9395b0bb3 100644 --- a/ext/standard/tests/dir/opendir_variation6.phpt +++ b/ext/standard/tests/dir/opendir_variation6.phpt @@ -45,16 +45,16 @@ rmdir($dir_path); -- Wildcard = '*' -- -Warning: opendir(%s/opendir_var*): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) -Warning: opendir(%s/*): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) -- Wildcard = '?' -- -Warning: opendir(%s/opendir_variation6/sub_dir?): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) -Warning: opendir(%s/opendir_variation6/sub?dir1): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) diff --git a/ext/standard/tests/dir/scandir_error2.phpt b/ext/standard/tests/dir/scandir_error2.phpt index d17feb1136be..a2668490b549 100644 --- a/ext/standard/tests/dir/scandir_error2.phpt +++ b/ext/standard/tests/dir/scandir_error2.phpt @@ -27,14 +27,14 @@ var_dump(scandir('/idonotexist')); -- Pass scandir() an absolute path that does not exist -- -Warning: scandir(%s/idonotexist): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno %d): %s in %s on line %d bool(false) -- Pass scandir() a relative path that does not exist -- -Warning: scandir(/idonotexist): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno %d): %s in %s on line %d bool(false) diff --git a/ext/standard/tests/dir/scandir_variation5.phpt b/ext/standard/tests/dir/scandir_variation5.phpt index 7bee9f087a7f..7b4f57b949c0 100644 --- a/ext/standard/tests/dir/scandir_variation5.phpt +++ b/ext/standard/tests/dir/scandir_variation5.phpt @@ -70,14 +70,14 @@ rmdir($parent_dir_path); -- After restricting 1st level parent directory -- -Warning: scandir(%s/scandir_variation5/sub_dir/child_dir): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno %d): %s in %s on line %d bool(false) -- After restricting parent directory -- -Warning: scandir(%s/scandir_variation5/sub_dir/child_dir): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno %d): %s in %s on line %d bool(false) diff --git a/ext/standard/tests/dir/scandir_variation6.phpt b/ext/standard/tests/dir/scandir_variation6.phpt index 60f64b5b60d7..82fcaf6fedef 100644 --- a/ext/standard/tests/dir/scandir_variation6.phpt +++ b/ext/standard/tests/dir/scandir_variation6.phpt @@ -46,24 +46,24 @@ rmdir($dir_path); -- Wildcard = '*' -- -Warning: scandir(%s/scandir_var*): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno %d): %s in %s on line %d bool(false) -Warning: scandir(%s/*): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno %d): %s in %s on line %d bool(false) -- Wildcard = '?' -- -Warning: scandir(%s/scandir_variation6/sub_dir?): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno %d): %s in %s on line %d bool(false) -Warning: scandir(%s/scandir_variation6/sub?dir1): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno %d): %s in %s on line %d bool(false) diff --git a/ext/standard/tests/file/007_variation15.phpt b/ext/standard/tests/file/007_variation15.phpt index 54e89d95f373..cbda911849de 100644 --- a/ext/standard/tests/file/007_variation15.phpt +++ b/ext/standard/tests/file/007_variation15.phpt @@ -55,5 +55,5 @@ int(0) bool(true) string(7) "Unknown" -Warning: fopen(%s): Failed to open stream: File exists in %s on line %d +Warning: fopen(): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/007_variation16.phpt b/ext/standard/tests/file/007_variation16.phpt index 7ce4f04a8619..a91374dd6dee 100644 --- a/ext/standard/tests/file/007_variation16.phpt +++ b/ext/standard/tests/file/007_variation16.phpt @@ -46,5 +46,5 @@ int(37) bool(true) string(7) "Unknown" -Warning: fopen(%s): Failed to open stream: File exists in %s on line %d +Warning: fopen(): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/007_variation23.phpt b/ext/standard/tests/file/007_variation23.phpt index f080596a2cd0..c475d08a37dc 100644 --- a/ext/standard/tests/file/007_variation23.phpt +++ b/ext/standard/tests/file/007_variation23.phpt @@ -46,5 +46,5 @@ int(0) bool(true) string(7) "Unknown" -Warning: fopen(%s): Failed to open stream: File exists in %s on line %d +Warning: fopen(): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/007_variation24.phpt b/ext/standard/tests/file/007_variation24.phpt index 3d4d4c4152ab..bfd2181b346e 100644 --- a/ext/standard/tests/file/007_variation24.phpt +++ b/ext/standard/tests/file/007_variation24.phpt @@ -46,5 +46,5 @@ int(37) bool(true) string(7) "Unknown" -Warning: fopen(%s): Failed to open stream: File exists in %s on line %d +Warning: fopen(): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/007_variation7.phpt b/ext/standard/tests/file/007_variation7.phpt index e25c1dd90830..59b703f8c1bd 100644 --- a/ext/standard/tests/file/007_variation7.phpt +++ b/ext/standard/tests/file/007_variation7.phpt @@ -46,5 +46,5 @@ int(0) bool(true) string(7) "Unknown" -Warning: fopen(%s): Failed to open stream: File exists in %s on line %d +Warning: fopen(): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/007_variation8.phpt b/ext/standard/tests/file/007_variation8.phpt index ec7cbae903d6..ab5dafb931a2 100644 --- a/ext/standard/tests/file/007_variation8.phpt +++ b/ext/standard/tests/file/007_variation8.phpt @@ -46,5 +46,5 @@ int(37) bool(true) string(7) "Unknown" -Warning: fopen(%s): Failed to open stream: File exists in %s on line %d +Warning: fopen(): Failed to open stream: File exists in %s on line %d *** Done *** diff --git a/ext/standard/tests/file/bug35740.phpt b/ext/standard/tests/file/bug35740.phpt index 29ab0248d8dc..1bba283abc33 100644 --- a/ext/standard/tests/file/bug35740.phpt +++ b/ext/standard/tests/file/bug35740.phpt @@ -8,7 +8,7 @@ include (__DIR__); echo "Done\n"; ?> --EXPECTF-- -Warning: include(%s): Failed to open stream: %s in %s on line %d +Warning: include(): Failed to open stream: %s in %s on line %d Warning: include(): Failed opening '%s' for inclusion (include_path='%s') in %s on line %d Done diff --git a/ext/standard/tests/file/bug43353.phpt b/ext/standard/tests/file/bug43353.phpt index 6089fabadd91..3a9ea39cc91e 100644 --- a/ext/standard/tests/file/bug43353.phpt +++ b/ext/standard/tests/file/bug43353.phpt @@ -2,6 +2,8 @@ Bug #43353 wrong detection of 'data' wrapper --INI-- allow_url_fopen=1 +zend.exception_string_param_max_len=1000000 +error_include_args=On --FILE-- --EXPECTF-- -Warning: fopen(%s): Failed to open stream: `Q' is not a valid mode for fopen in %s on line %d +Warning: fopen(): Failed to open stream: `Q' is not a valid mode for fopen in %s on line %d diff --git a/ext/standard/tests/file/copy_error.phpt b/ext/standard/tests/file/copy_error.phpt index 3814c3d5f262..fb989a358389 100644 --- a/ext/standard/tests/file/copy_error.phpt +++ b/ext/standard/tests/file/copy_error.phpt @@ -11,6 +11,6 @@ echo "*** Done ***\n"; --EXPECTF-- *** Testing copy() function: error conditions -- -Warning: copy(/no/file): Failed to open stream: No such file or directory in %s on line %d +Warning: copy(): Failed to open stream: No such file or directory in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/copy_variation14.phpt b/ext/standard/tests/file/copy_variation14.phpt index a79bbf69c5b5..c4ff093ea773 100644 --- a/ext/standard/tests/file/copy_variation14.phpt +++ b/ext/standard/tests/file/copy_variation14.phpt @@ -29,12 +29,12 @@ unlink(__DIR__."/copy_variation14.tmp"); ?> --EXPECTF-- *** Test copy() function: Trying to create a copy of non-existing source in existing destination *** -Warning: copy(%s): %s +Warning: copy(): %s bool(false) bool(false) *** Test copy() function: Trying to create copy of an existing source in non-existing destination *** -Warning: copy(%s): %s +Warning: copy(): %s bool(false) bool(false) int(1500) diff --git a/ext/standard/tests/file/copy_variation15.phpt b/ext/standard/tests/file/copy_variation15.phpt index abe425a4e323..0068d46a0d41 100644 --- a/ext/standard/tests/file/copy_variation15.phpt +++ b/ext/standard/tests/file/copy_variation15.phpt @@ -42,7 +42,7 @@ rmdir(__DIR__."/copy_variation15"); ?> --EXPECTF-- *** Test copy() function: Trying to create a copy of file in a dir which doesn't have write permissions *** -Warning: copy(%s): %s +Warning: copy(): %s bool(false) bool(false) int(300) diff --git a/ext/standard/tests/file/copy_variation16-win32.phpt b/ext/standard/tests/file/copy_variation16-win32.phpt index d2730ce33256..05607042506f 100644 --- a/ext/standard/tests/file/copy_variation16-win32.phpt +++ b/ext/standard/tests/file/copy_variation16-win32.phpt @@ -125,7 +125,7 @@ Size of destination file => int(3500) -- Iteration 7 -- Size of source file => int(3500) Copy operation => -Warning: copy(%s): Failed to open stream: No such file or directory in %s on line %d +Warning: copy(): Failed to open stream: No such file or directory in %s on line %d bool(false) Existence of destination file => bool(false) diff --git a/ext/standard/tests/file/copy_variation17.phpt b/ext/standard/tests/file/copy_variation17.phpt index 446d72d35db7..9c46eeb2601d 100644 --- a/ext/standard/tests/file/copy_variation17.phpt +++ b/ext/standard/tests/file/copy_variation17.phpt @@ -51,19 +51,19 @@ bool(true) bool(true) int(1500) -Warning: copy(%s): %s +Warning: copy(): %s bool(false) bool(false) -Warning: copy(%s): %s +Warning: copy(): %s bool(false) bool(false) -Warning: copy(%s): %s +Warning: copy(): %s bool(false) bool(false) -Warning: copy(%s): %s +Warning: copy(): %s bool(false) bool(false) *** Done *** diff --git a/ext/standard/tests/file/copy_variation2-win32-mb.phpt b/ext/standard/tests/file/copy_variation2-win32-mb.phpt index 67d84ee3e32c..3d1da3377954 100644 --- a/ext/standard/tests/file/copy_variation2-win32-mb.phpt +++ b/ext/standard/tests/file/copy_variation2-win32-mb.phpt @@ -117,13 +117,13 @@ Size of destination file => int(1500) -- Iteration 5 -- Copy operation => -Warning: copy(%s): %s +Warning: copy(): %s bool(false) Existence of destination file => bool(false) -- Iteration 6 -- Copy operation => -Warning: copy(%s): %s +Warning: copy(): %s bool(false) Existence of destination file => bool(false) @@ -150,7 +150,7 @@ Size of destination file => int(1500) -- Iteration 10 -- Copy operation => -Warning: copy(%s): %s +Warning: copy(): %s bool(false) Existence of destination file => bool(false) @@ -191,7 +191,7 @@ Size of destination file => int(1500) -- Iteration 16 -- Copy operation => -Warning: copy(%s): %s +Warning: copy(): %s bool(false) Existence of destination file => bool(false) diff --git a/ext/standard/tests/file/copy_variation2-win32.phpt b/ext/standard/tests/file/copy_variation2-win32.phpt index c8f695efea7d..eb8c7042fe21 100644 --- a/ext/standard/tests/file/copy_variation2-win32.phpt +++ b/ext/standard/tests/file/copy_variation2-win32.phpt @@ -117,13 +117,13 @@ Size of destination file => int(1500) -- Iteration 5 -- Copy operation => -Warning: copy(%s): %s +Warning: copy(): %s bool(false) Existence of destination file => bool(false) -- Iteration 6 -- Copy operation => -Warning: copy(%s): %s +Warning: copy(): %s bool(false) Existence of destination file => bool(false) @@ -150,7 +150,7 @@ Size of destination file => int(1500) -- Iteration 10 -- Copy operation => -Warning: copy(%s): %s +Warning: copy(): %s bool(false) Existence of destination file => bool(false) @@ -191,7 +191,7 @@ Size of destination file => int(1500) -- Iteration 16 -- Copy operation => -Warning: copy(%s): %s +Warning: copy(): %s bool(false) Existence of destination file => bool(false) diff --git a/ext/standard/tests/file/copy_variation3-win32.phpt b/ext/standard/tests/file/copy_variation3-win32.phpt index ed4cbfb89bdc..ee5678a8ab4a 100644 --- a/ext/standard/tests/file/copy_variation3-win32.phpt +++ b/ext/standard/tests/file/copy_variation3-win32.phpt @@ -92,13 +92,13 @@ Size of destination file => int(1500) -- Iteration 3 -- Copy operation => -Warning: copy(%s): %s +Warning: copy(): %s bool(false) Existence of destination file => bool(false) -- Iteration 4 -- Copy operation => -Warning: copy(%s): %s +Warning: copy(): %s bool(false) Existence of destination file => bool(false) *** Done *** diff --git a/ext/standard/tests/file/copy_variation6-win32.phpt b/ext/standard/tests/file/copy_variation6-win32.phpt index c0b3ec972024..32c21a450c1a 100644 --- a/ext/standard/tests/file/copy_variation6-win32.phpt +++ b/ext/standard/tests/file/copy_variation6-win32.phpt @@ -124,7 +124,7 @@ Size of destination file => int(0) -- Iteration 7 -- Copy operation => -Warning: copy(%s/copy_variation6/copy_variation6_sub///../*): Failed to open stream: No such file or directory in %s on line %d +Warning: copy(): Failed to open stream: No such file or directory in %s on line %d bool(false) Existence of destination file => bool(false) diff --git a/ext/standard/tests/file/file_error.phpt b/ext/standard/tests/file/file_error.phpt index 69bb93c0b7ae..fffad3c59b64 100644 --- a/ext/standard/tests/file/file_error.phpt +++ b/ext/standard/tests/file/file_error.phpt @@ -32,7 +32,7 @@ unlink($file_path."/file.tmp"); ValueError: file(): Argument #2 ($flags) must be a valid flag value ValueError: file(): Argument #2 ($flags) must be a valid flag value -Warning: file(temp.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file(): Failed to open stream: No such file or directory in %s on line %d bool(false) --- Done --- diff --git a/ext/standard/tests/file/file_get_contents_error.phpt b/ext/standard/tests/file/file_get_contents_error.phpt index 5ac352123b30..add7831ef390 100644 --- a/ext/standard/tests/file/file_get_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_error.phpt @@ -11,7 +11,7 @@ $file_path = __DIR__; include($file_path."/file.inc"); echo "\n-- Testing with Non-existing file --\n"; -print( file_get_contents("/no/such/file/or/dir") ); +var_dump( file_get_contents("/no/such/file/or/dir") ); create_files($file_path, 1, "text", 0755, 100, "w", "file_get_contents_error", 1, "byte"); $file_handle = fopen($file_path."/file_put_contents_error.tmp", "w"); @@ -44,7 +44,8 @@ if(file_exists($file_path."/file_put_contents1.tmp")) { -- Testing with Non-existing file -- -Warning: file_get_contents(/no/such/file/or/dir): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d +bool(false) -- Testing for invalid negative maxlen values -- file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 diff --git a/ext/standard/tests/file/file_get_contents_error_folder-win.phpt b/ext/standard/tests/file/file_get_contents_error_folder-win.phpt index ea3902fdbe06..9d3615353f7e 100644 --- a/ext/standard/tests/file/file_get_contents_error_folder-win.phpt +++ b/ext/standard/tests/file/file_get_contents_error_folder-win.phpt @@ -9,4 +9,4 @@ if (substr(PHP_OS, 0, 3) != "WIN") { print "skip - Windows only"; } file_get_contents(__DIR__); ?> --EXPECTF-- -Warning: file_get_contents(%s): Failed to open stream: Permission denied in %s on line %d +Warning: file_get_contents(): Failed to open stream: Permission denied in %s on line %d diff --git a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt index 91a37cd2e1ac..7133ae766d68 100644 --- a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt @@ -31,7 +31,7 @@ unlink($file_path."/file_put_contents_error1.tmp"); -- Testing with Non-existing file -- -Warning: file_get_contents(/no/such/file/or/dir): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d -- Testing for invalid negative maxlen values -- file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 diff --git a/ext/standard/tests/file/file_get_contents_variation7-win32-mb.phpt b/ext/standard/tests/file/file_get_contents_variation7-win32-mb.phpt index 5dfa6227bccf..9bb97c623b44 100644 --- a/ext/standard/tests/file/file_get_contents_variation7-win32-mb.phpt +++ b/ext/standard/tests/file/file_get_contents_variation7-win32-mb.phpt @@ -87,12 +87,12 @@ string(%d) "contents read" -- Iteration 5 -- -Warning: file_get_contents(%sfileGetContentsVar7私はガラスを食べられます.dir\fileGetContentsVar7Sub私はガラスを食べられます\..\\\fileGetContentsVar7Sub私はガラスを食べられます\\..\\..\fileGetContentsVar7Sub私はガラスを食べられます\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: file_get_contents(%sfileGetContentsVar7私はガラスを食べられます.dir\fileGetContentsVar7Sub私はガラスを食べられます\BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -109,7 +109,7 @@ string(%d) "contents read" -- Iteration 11 -- -Warning: file_get_contents(BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/file_get_contents_variation7-win32.phpt b/ext/standard/tests/file/file_get_contents_variation7-win32.phpt index a353630c9532..0cf7cc7d5aac 100644 --- a/ext/standard/tests/file/file_get_contents_variation7-win32.phpt +++ b/ext/standard/tests/file/file_get_contents_variation7-win32.phpt @@ -87,12 +87,12 @@ string(%d) "contents read" -- Iteration 5 -- -Warning: file_get_contents(%sfileGetContentsVar7.dir\fileGetContentsVar7Sub\..\\\fileGetContentsVar7Sub\\..\\..\fileGetContentsVar7Sub\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: file_get_contents(%sfileGetContentsVar7.dir\fileGetContentsVar7Sub\BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -109,7 +109,7 @@ string(%d) "contents read" -- Iteration 11 -- -Warning: file_get_contents(BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/file_get_contents_variation7.phpt b/ext/standard/tests/file/file_get_contents_variation7.phpt index 2d574c6410b0..25a31c6dea9c 100644 --- a/ext/standard/tests/file/file_get_contents_variation7.phpt +++ b/ext/standard/tests/file/file_get_contents_variation7.phpt @@ -79,12 +79,12 @@ string(%d) "contents read" -- Iteration 5 -- -Warning: file_get_contents(%sfileGetContentsVar7.dir/fileGetContentsVar7Sub/..///fileGetContentsVar7Sub//..//../fileGetContentsVar7Sub/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: file_get_contents(%sfileGetContentsVar7.dir/fileGetContentsVar7Sub/BADDIR/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -101,7 +101,7 @@ string(%d) "contents read" -- Iteration 11 -- -Warning: file_get_contents(BADDIR/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/file_get_contents_variation8-win32.phpt b/ext/standard/tests/file/file_get_contents_variation8-win32.phpt index ee408b2c9758..204a5c777257 100644 --- a/ext/standard/tests/file/file_get_contents_variation8-win32.phpt +++ b/ext/standard/tests/file/file_get_contents_variation8-win32.phpt @@ -46,12 +46,12 @@ foreach($names_arr as $key =>$value) { -- Filename: -1 -- -Warning: file_get_contents(-1): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Filename: TRUE -- -Warning: file_get_contents(1): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Filename: FALSE -- @@ -62,7 +62,7 @@ ValueError: Path must not be empty -- Filename: " " -- -Warning: file_get_contents( ): Failed to open stream: Permission denied in %s on line %d +Warning: file_get_contents(): Failed to open stream: Permission denied in %s on line %d bool(false) -- Filename: \0 -- @@ -73,10 +73,10 @@ TypeError: file_get_contents(): Argument #1 ($filename) must be of type string, -- Filename: /no/such/file/dir -- -Warning: file_get_contents(/no/such/file/dir): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Filename: php/php -- -Warning: file_get_contents(php/php): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/file/file_get_contents_variation8.phpt b/ext/standard/tests/file/file_get_contents_variation8.phpt index d6edef55db61..94d3a31c775e 100644 --- a/ext/standard/tests/file/file_get_contents_variation8.phpt +++ b/ext/standard/tests/file/file_get_contents_variation8.phpt @@ -45,11 +45,11 @@ echo "\n*** Done ***\n"; *** Testing file_get_contents() : variation *** -- Iteration 0 -- -Warning: file_get_contents(-1): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 1 -- -Warning: file_get_contents(1): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 2 -- ValueError: Path must not be empty @@ -57,7 +57,7 @@ ValueError: Path must not be empty ValueError: Path must not be empty -- Iteration 4 -- -Warning: file_get_contents( ): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 5 -- ValueError: file_get_contents(): Argument #1 ($filename) must not contain any null bytes @@ -65,11 +65,11 @@ ValueError: file_get_contents(): Argument #1 ($filename) must not contain any nu TypeError: file_get_contents(): Argument #1 ($filename) must be of type string, array given -- Iteration 7 -- -Warning: file_get_contents(/no/such/file/dir): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 8 -- -Warning: file_get_contents(php/php): Failed to open stream: No such file or directory in %s on line %d +Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt b/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt index b5070b740238..01ee940d9531 100644 --- a/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt +++ b/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt @@ -39,11 +39,11 @@ var_dump(file_get_contents("http://exa%23mple.org", context: $context)); // inva --EXPECTF-- file_get_contents(): Provided stream context has invalid value for the "uri_parser_class" option -Warning: file_get_contents(http:///example.com): Failed to open stream: operation failed in %s on line %d +Warning: file_get_contents(): Failed to open stream: operation failed in %s on line %d bool(false) -Warning: file_get_contents(http://éxamplé.com): Failed to open stream: operation failed in %s on line %d +Warning: file_get_contents(): Failed to open stream: operation failed in %s on line %d bool(false) -Warning: file_get_contents(http://exa%23mple.org): Failed to open stream: operation failed in %s on line %d +Warning: file_get_contents(): Failed to open stream: operation failed in %s on line %d bool(false) diff --git a/ext/standard/tests/file/file_put_contents_variation7-win32.phpt b/ext/standard/tests/file/file_put_contents_variation7-win32.phpt index fe9796979d13..b41af4b1128b 100644 --- a/ext/standard/tests/file/file_put_contents_variation7-win32.phpt +++ b/ext/standard/tests/file/file_put_contents_variation7-win32.phpt @@ -103,12 +103,12 @@ Data written correctly -- Iteration 5 -- -Warning: file_put_contents(%sfilePutContentsVar7.dir\filePutContentsVar7Sub\..\\\filePutContentsVar7Sub\\..\\..\filePutContentsVar7Sub\FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d No data written -- Iteration 6 -- -Warning: file_put_contents(%sfilePutContentsVar7.dir\filePutContentsVar7Sub\BADDIR\FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d No data written -- Iteration 7 -- @@ -125,7 +125,7 @@ Data written correctly -- Iteration 11 -- -Warning: file_put_contents(BADDIR\FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d No data written -- Iteration 12 -- diff --git a/ext/standard/tests/file/file_put_contents_variation7.phpt b/ext/standard/tests/file/file_put_contents_variation7.phpt index fe9cfe57894a..260ee1cf5bfa 100644 --- a/ext/standard/tests/file/file_put_contents_variation7.phpt +++ b/ext/standard/tests/file/file_put_contents_variation7.phpt @@ -100,12 +100,12 @@ Data written correctly -- Iteration 5 -- -Warning: file_put_contents(%sfilePutContentsVar7.dir/filePutContentsVar7Sub/..///filePutContentsVar7Sub//..//../filePutContentsVar7Sub/FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d No data written -- Iteration 6 -- -Warning: file_put_contents(%sfilePutContentsVar7.dir/filePutContentsVar7Sub/BADDIR/FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d No data written -- Iteration 7 -- @@ -122,7 +122,7 @@ Data written correctly -- Iteration 11 -- -Warning: file_put_contents(BADDIR/FileGetContentsVar7.tmp): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d No data written *** Done *** diff --git a/ext/standard/tests/file/file_put_contents_variation8-win32.phpt b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt index b1625f030b06..221bffc54db0 100644 --- a/ext/standard/tests/file/file_put_contents_variation8-win32.phpt +++ b/ext/standard/tests/file/file_put_contents_variation8-win32.phpt @@ -62,7 +62,7 @@ ValueError: Path must not be empty -- Filename: " " -- -Warning: file_put_contents( ): Failed to open stream: Permission denied in %s on line %d +Warning: file_put_contents(): Failed to open stream: Permission denied in %s on line %d Failed to write data to: " " -- Filename: \0 -- @@ -73,10 +73,10 @@ TypeError: file_put_contents(): Argument #1 ($filename) must be of type string, -- Filename: /no/such/file/dir -- -Warning: file_put_contents(/no/such/file/dir): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d Failed to write data to: /no/such/file/dir -- Filename: php/php -- -Warning: file_put_contents(php/php): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d Failed to write data to: php/php diff --git a/ext/standard/tests/file/file_put_contents_variation8.phpt b/ext/standard/tests/file/file_put_contents_variation8.phpt index 81bbd2516880..12ae8379f699 100644 --- a/ext/standard/tests/file/file_put_contents_variation8.phpt +++ b/ext/standard/tests/file/file_put_contents_variation8.phpt @@ -75,11 +75,11 @@ ValueError: file_put_contents(): Argument #1 ($filename) must not contain any nu TypeError: file_put_contents(): Argument #1 ($filename) must be of type string, array given -- Iteration 7 -- -Warning: file_put_contents(%sdir): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d Failed to write data to: '%sir' -- Iteration 8 -- -Warning: file_put_contents(%sphp): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d Failed to write data to: '%sphp' *** Done *** diff --git a/ext/standard/tests/file/file_variation8-win32.phpt b/ext/standard/tests/file/file_variation8-win32.phpt index 2aeaf451ae96..644bebe8a2d5 100644 --- a/ext/standard/tests/file/file_variation8-win32.phpt +++ b/ext/standard/tests/file/file_variation8-win32.phpt @@ -99,12 +99,12 @@ array(1) { -- Iteration 5 -- -Warning: file(%sfileVar8_win32.dir\fileVar8Sub\..\\\fileVar8Sub\\..\\..\fileVar8Sub\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: file(%sfileVar8_win32.dir\fileVar8Sub\BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -133,7 +133,7 @@ array(1) { -- Iteration 11 -- -Warning: file(BADDIR\FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/file_variation8.phpt b/ext/standard/tests/file/file_variation8.phpt index 8c79a3bb4f48..cefb26a54440 100644 --- a/ext/standard/tests/file/file_variation8.phpt +++ b/ext/standard/tests/file/file_variation8.phpt @@ -91,12 +91,12 @@ array(1) { -- Iteration 5 -- -Warning: file(%sfileVar8.dir/fileVar8Sub/..///fileVar8Sub//..//../fileVar8Sub/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: file(%sfileVar8.dir/fileVar8Sub/BADDIR/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -125,7 +125,7 @@ array(1) { -- Iteration 11 -- -Warning: file(BADDIR/FileGetContentsVar7.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: file(): Failed to open stream: No such file or directory in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/fopen_variation10-win32.phpt b/ext/standard/tests/file/fopen_variation10-win32.phpt index 45ec3052cdcb..b87f5b181164 100644 --- a/ext/standard/tests/file/fopen_variation10-win32.phpt +++ b/ext/standard/tests/file/fopen_variation10-win32.phpt @@ -88,17 +88,17 @@ file in root --c-- -Warning: fopen(c\fopen_variation10.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: fopen(): Failed to open stream: No such file or directory in %s on line %d file not opened for read --\-- -Warning: fopen(\\fopen_variation10.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: fopen(): Failed to open stream: No such file or directory in %s on line %d file not opened for read --/-- -Warning: fopen(/\fopen_variation10.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: fopen(): Failed to open stream: No such file or directory in %s on line %d file not opened for read --c:fopen10.tmpdirTwo-- @@ -106,7 +106,7 @@ file in fopen10.tmpdirTwo --c:adir-- -Warning: fopen(c:adir\fopen_variation10.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: fopen(): Failed to open stream: No such file or directory in %s on line %d file not opened for read --c:\/-- @@ -126,5 +126,5 @@ file in fopen10.tmpDir --/sortout-- -Warning: fopen(/sortout\fopen_variation10.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: fopen(): Failed to open stream: No such file or directory in %s on line %d file not opened for read diff --git a/ext/standard/tests/file/fopen_variation11-win32.phpt b/ext/standard/tests/file/fopen_variation11-win32.phpt index 22368812637b..60eeb562a962 100644 --- a/ext/standard/tests/file/fopen_variation11-win32.phpt +++ b/ext/standard/tests/file/fopen_variation11-win32.phpt @@ -86,17 +86,17 @@ file in root --c-- -Warning: fopen(c\fopen_variation11.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: fopen(): Failed to open stream: No such file or directory in %s on line %d file not opened for read --\-- -Warning: fopen(\\FOPEN_VARIATION11.TMP): Failed to open stream: No such file or directory in %s on line %d +Warning: fopen(): Failed to open stream: No such file or directory in %s on line %d file not opened for read --/-- -Warning: fopen(\\FOPEN_VARIATION11.TMP): Failed to open stream: No such file or directory in %s on line %d +Warning: fopen(): Failed to open stream: No such file or directory in %s on line %d file not opened for read --c:fopen11.tmpdirTwo-- @@ -104,7 +104,7 @@ file in fopen11.tmpdirTwo --c:adir-- -Warning: fopen(c:adir\fopen_variation11.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: fopen(): Failed to open stream: No such file or directory in %s on line %d file not opened for read --c:\/-- @@ -124,5 +124,5 @@ file in fopen11.tmpDir --/sortout-- -Warning: fopen(/sortout\fopen_variation11.tmp): Failed to open stream: No such file or directory in %s on line %d +Warning: fopen(): Failed to open stream: No such file or directory in %s on line %d file not opened for read diff --git a/ext/standard/tests/file/fopen_variation14-win32.phpt b/ext/standard/tests/file/fopen_variation14-win32.phpt index 71a0ecd0c70d..ae0049cdbe17 100644 --- a/ext/standard/tests/file/fopen_variation14-win32.phpt +++ b/ext/standard/tests/file/fopen_variation14-win32.phpt @@ -98,42 +98,42 @@ function runtest($fileURIs) { Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen14.tmpDir\fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://fopen14.tmpDir/fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen14.tmpDir/fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://./fopen14.tmpDir/fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://./fopen14.tmpDir/fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://.\fopen14.tmpDir\fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://.\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://.\fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://.\fopen14.tmpDir\fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://.\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://.\fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- test passed --- WRITE: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- @@ -150,22 +150,22 @@ test passed Warning: fopen(): Remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://../fopen14.tmpDir/fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://..\fopen14.tmpDir\fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://..\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://..\fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://..\fopen14.tmpDir\fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://..\fopen14.tmpDir\fopen_variation14.tmp in %s on line %d -Warning: fopen(file://..\fopen14.tmpDir\fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- test passed --- WRITE: file://%s/fopen14.tmpDir/fopen_variation14.tmp --- diff --git a/ext/standard/tests/file/fopen_variation14.phpt b/ext/standard/tests/file/fopen_variation14.phpt index 554527d08771..5fc8d92b7a0a 100644 --- a/ext/standard/tests/file/fopen_variation14.phpt +++ b/ext/standard/tests/file/fopen_variation14.phpt @@ -90,22 +90,22 @@ function runtest($fileURIs) { Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen14.tmpDir/fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://./fopen14.tmpDir/fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://./fopen14.tmpDir/fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://./fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://./fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- test passed --- WRITE: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- @@ -114,12 +114,12 @@ test passed Warning: fopen(): Remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://../fopen14.tmpDir/fopen_variation14.tmp --- Warning: fopen(): Remote host file access not supported, file://../fopen14.tmpDir/fopen_variation14.tmp in %s on line %d -Warning: fopen(file://../fopen14.tmpDir/fopen_variation14.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- test passed --- WRITE: file:///%s/fopen14.tmpDir/fopen_variation14.tmp --- diff --git a/ext/standard/tests/file/fopen_variation15-win32.phpt b/ext/standard/tests/file/fopen_variation15-win32.phpt index edabaa5c5caf..266ea0d13ce9 100644 --- a/ext/standard/tests/file/fopen_variation15-win32.phpt +++ b/ext/standard/tests/file/fopen_variation15-win32.phpt @@ -102,42 +102,42 @@ function runtest($fileURIs) { Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen15.tmpDir\fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://fopen15.tmpDir/fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen15.tmpDir/fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://./fopen15.tmpDir/fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://./fopen15.tmpDir/fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://.\fopen15.tmpDir\fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://.\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://.\fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://.\fopen15.tmpDir\fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://.\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://.\fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- test passed --- WRITE: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- @@ -154,22 +154,22 @@ test passed Warning: fopen(): Remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://../fopen15.tmpDir/fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://..\fopen15.tmpDir\fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://..\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://..\fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://..\fopen15.tmpDir\fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://..\fopen15.tmpDir\fopen_variation15.tmp in %s on line %d -Warning: fopen(file://..\fopen15.tmpDir\fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- test passed --- WRITE: file://%s/fopen15.tmpDir/fopen_variation15.tmp --- diff --git a/ext/standard/tests/file/fopen_variation15.phpt b/ext/standard/tests/file/fopen_variation15.phpt index a182865bcbbc..b6cc92548dfc 100644 --- a/ext/standard/tests/file/fopen_variation15.phpt +++ b/ext/standard/tests/file/fopen_variation15.phpt @@ -94,22 +94,22 @@ function runtest($fileURIs) { Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://fopen15.tmpDir/fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file://./fopen15.tmpDir/fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://./fopen15.tmpDir/fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://./fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://./fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- test passed --- WRITE: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- @@ -118,12 +118,12 @@ test passed Warning: fopen(): Remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- WRITE: file://../fopen15.tmpDir/fopen_variation15.tmp --- Warning: fopen(): Remote host file access not supported, file://../fopen15.tmpDir/fopen_variation15.tmp in %s on line %d -Warning: fopen(file://../fopen15.tmpDir/fopen_variation15.tmp): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d --- READ: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- test passed --- WRITE: file:///%s/fopen15.tmpDir/fopen_variation15.tmp --- diff --git a/ext/standard/tests/file/include_userstream_002.phpt b/ext/standard/tests/file/include_userstream_002.phpt index 263576076273..bf0a10963935 100644 --- a/ext/standard/tests/file/include_userstream_002.phpt +++ b/ext/standard/tests/file/include_userstream_002.phpt @@ -101,8 +101,8 @@ include "test2://hello"; Warning: fopen(): test1:// wrapper is disabled in the server configuration by allow_url_include=0 in %sinclude_userstream_002.php on line 11 -Warning: fopen(test1://hello): Failed to open stream: no suitable wrapper could be found in %sinclude_userstream_002.php on line 11 +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %sinclude_userstream_002.php on line 11 -Warning: include(test2://hello): Failed to open stream: "test::stream_open" call failed in %sinclude_userstream_002.php on line 90 +Warning: include(): Failed to open stream: "test::stream_open" call failed in %sinclude_userstream_002.php on line 90 Warning: include(): Failed opening 'test2://hello' for inclusion (include_path='%s') in %sinclude_userstream_002.php on line 90 diff --git a/ext/standard/tests/file/include_userstream_003.phpt b/ext/standard/tests/file/include_userstream_003.phpt index 1f2c44821f86..1a9c96833c90 100644 --- a/ext/standard/tests/file/include_userstream_003.phpt +++ b/ext/standard/tests/file/include_userstream_003.phpt @@ -100,26 +100,26 @@ Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0 Warning: file_get_contents(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %s on line %d -Warning: file_get_contents(test1://hello): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: file_get_contents(): Failed to open stream: no suitable wrapper could be found in %s on line %d Warning: include(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %s on line %d -Warning: include(test1://hello): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: include(): Failed to open stream: no suitable wrapper could be found in %s on line %d Warning: include(): Failed opening 'test1://hello' for inclusion (include_path='%s') in %s on line %d Warning: fopen(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %s on line %d -Warning: fopen(test1://hello): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d -Warning: file_get_contents(test2://hello): Failed to open stream: "test::stream_open" call failed in %s on line %d +Warning: file_get_contents(): Failed to open stream: "test::stream_open" call failed in %s on line %d Warning: fopen(): test1:// wrapper is disabled in the server configuration by allow_url_fopen=0 in %s on line %d -Warning: fopen(test1://hello): Failed to open stream: no suitable wrapper could be found in %s on line %d +Warning: fopen(): Failed to open stream: no suitable wrapper could be found in %s on line %d -Warning: include(test2://hello): Failed to open stream: "test::stream_open" call failed in %s on line %d +Warning: include(): Failed to open stream: "test::stream_open" call failed in %s on line %d Warning: include(): Failed opening 'test2://hello' for inclusion (include_path='%s') in %s on line %d diff --git a/ext/standard/tests/file/open_basedir_cwd_resolve.phpt b/ext/standard/tests/file/open_basedir_cwd_resolve.phpt index 9c95e4904fa0..074a015e1c14 100644 --- a/ext/standard/tests/file/open_basedir_cwd_resolve.phpt +++ b/ext/standard/tests/file/open_basedir_cwd_resolve.phpt @@ -11,5 +11,5 @@ var_dump(file_get_contents('/some/path/outside/open/basedir')); --EXPECTF-- Warning: file_get_contents(): open_basedir restriction in effect. File(/some/path/outside/open/basedir) is not within the allowed path(s): (%s) in %s on line %d -Warning: file_get_contents(/some/path/outside/open/basedir): Failed to open stream: %r(Operation not permitted|Insufficient privileges)%r in %s on line %d +Warning: file_get_contents(): Failed to open stream: %r(Operation not permitted|Insufficient privileges)%r in %s on line %d bool(false) diff --git a/ext/standard/tests/file/parse_ini_file_error.phpt b/ext/standard/tests/file/parse_ini_file_error.phpt index ce4952f1083f..583be4380061 100644 --- a/ext/standard/tests/file/parse_ini_file_error.phpt +++ b/ext/standard/tests/file/parse_ini_file_error.phpt @@ -22,11 +22,11 @@ echo "Done"; -- Testing parse_ini_file() function with more than expected no. of arguments -- -Warning: parse_ini_file(%s): Failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Testing parse_ini_file() function with a non-existent file -- -Warning: parse_ini_file(%s): Failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) Done diff --git a/ext/standard/tests/file/parse_ini_file_variation6-win32-mb.phpt b/ext/standard/tests/file/parse_ini_file_variation6-win32-mb.phpt index c5c5934062cc..6834964a043c 100644 --- a/ext/standard/tests/file/parse_ini_file_variation6-win32-mb.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation6-win32-mb.phpt @@ -91,12 +91,12 @@ array(1) { -- Iteration 5 -- -Warning: parse_ini_file(%sparseIniFileVar私はガラスを食べられます.dir\parseIniFileVar私はガラスを食べられますSub\..\\\parseIniFileVar私はガラスを食べられますSub\\..\\..\parseIniFileVar私はガラスを食べられますSub\parseIniFileVar私はガラスを食べられます.ini): Failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: parse_ini_file(%sparseIniFileVar私はガラスを食べられます.dir\parseIniFileVar私はガラスを食べられますSub\BADDIR\parseIniFileVar私はガラスを食べられます.ini): Failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -125,7 +125,7 @@ array(1) { -- Iteration 11 -- -Warning: parse_ini_file(BADDIR\parseIniFileVar私はガラスを食べられます.ini): Failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/parse_ini_file_variation6-win32.phpt b/ext/standard/tests/file/parse_ini_file_variation6-win32.phpt index a7b005c6e9aa..b187c1ed2173 100644 --- a/ext/standard/tests/file/parse_ini_file_variation6-win32.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation6-win32.phpt @@ -91,12 +91,12 @@ array(1) { -- Iteration 5 -- -Warning: parse_ini_file(%sparseIniFileVar6.dir\parseIniFileVar6Sub\..\\\parseIniFileVar6Sub\\..\\..\parseIniFileVar6Sub\ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: parse_ini_file(%sparseIniFileVar6.dir\parseIniFileVar6Sub\BADDIR\ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -125,7 +125,7 @@ array(1) { -- Iteration 11 -- -Warning: parse_ini_file(BADDIR\ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 12 -- diff --git a/ext/standard/tests/file/parse_ini_file_variation6.phpt b/ext/standard/tests/file/parse_ini_file_variation6.phpt index 4c84672821d8..03fde0dc3032 100644 --- a/ext/standard/tests/file/parse_ini_file_variation6.phpt +++ b/ext/standard/tests/file/parse_ini_file_variation6.phpt @@ -87,12 +87,12 @@ array(1) { -- Iteration 5 -- -Warning: parse_ini_file(%sparseIniFileVar6.dir/parseIniFileVar6Sub/..///parseIniFileVar6Sub//..//../parseIniFileVar6Sub/ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 6 -- -Warning: parse_ini_file(%sparseIniFileVar6.dir/parseIniFileVar6Sub/BADDIR/ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Iteration 7 -- @@ -121,7 +121,7 @@ array(1) { -- Iteration 11 -- -Warning: parse_ini_file(BADDIR/ParseIniFileVar6.ini): Failed to open stream: No such file or directory in %s on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/php_fd_wrapper_03.phpt b/ext/standard/tests/file/php_fd_wrapper_03.phpt index a19d1f5acd94..f8ce8ffef61f 100644 --- a/ext/standard/tests/file/php_fd_wrapper_03.phpt +++ b/ext/standard/tests/file/php_fd_wrapper_03.phpt @@ -11,12 +11,12 @@ echo "\nDone.\n"; ?> --EXPECTF-- -Warning: fopen(php://fd): Failed to open stream: operation failed in %s on line 2 +Warning: fopen(): Failed to open stream: operation failed in %s on line 2 -Warning: fopen(php://fd/): Failed to open stream: php://fd/ stream must be specified in the form php://fd/ in %s on line %d +Warning: fopen(): Failed to open stream: php://fd/ stream must be specified in the form php://fd/ in %s on line %d -Warning: fopen(php://fd/-2): Failed to open stream: The file descriptors must be non-negative numbers smaller than %d in %s on line %d +Warning: fopen(): Failed to open stream: The file descriptors must be non-negative numbers smaller than %d in %s on line %d -Warning: fopen(php://fd/1/): Failed to open stream: php://fd/ stream must be specified in the form php://fd/ in %s on line %d +Warning: fopen(): Failed to open stream: php://fd/ stream must be specified in the form php://fd/ in %s on line %d Done. diff --git a/ext/standard/tests/file/php_fd_wrapper_04.phpt b/ext/standard/tests/file/php_fd_wrapper_04.phpt index e1f9927ee9d2..068866f9adb2 100644 --- a/ext/standard/tests/file/php_fd_wrapper_04.phpt +++ b/ext/standard/tests/file/php_fd_wrapper_04.phpt @@ -12,6 +12,6 @@ fopen("php://fd/1023", "w"); echo "\nDone.\n"; ?> --EXPECTF-- -Warning: fopen(php://fd/1023): Failed to open stream: Error duping file descriptor 1023; possibly it doesn't exist: [9]: %s in %s on line %d +Warning: fopen(): Failed to open stream: Error duping file descriptor 1023; possibly it doesn't exist: [9]: %s in %s on line %d Done. diff --git a/ext/standard/tests/file/readfile_error.phpt b/ext/standard/tests/file/readfile_error.phpt index ec2cf53946a6..d21554296a15 100644 --- a/ext/standard/tests/file/readfile_error.phpt +++ b/ext/standard/tests/file/readfile_error.phpt @@ -34,6 +34,6 @@ Path must not be empty -- Testing readfile() with non-existent file -- -Warning: readfile(%s/non_existent_file.tmp): Failed to open stream: %s in %s on line %d +Warning: readfile(): Failed to open stream: %s in %s on line %d bool(false) Done diff --git a/ext/standard/tests/file/readfile_variation10-win32.phpt b/ext/standard/tests/file/readfile_variation10-win32.phpt index 2ec770b4101c..1dbb896fbc8c 100644 --- a/ext/standard/tests/file/readfile_variation10-win32.phpt +++ b/ext/standard/tests/file/readfile_variation10-win32.phpt @@ -44,11 +44,11 @@ foreach($names_arr as $key => $value) { -- Filename: -1 -- -Warning: readfile(-1): Failed to open stream: No such file or directory in %s on line %d +Warning: readfile(): Failed to open stream: No such file or directory in %s on line %d -- Filename: TRUE -- -Warning: readfile(1): Failed to open stream: No such file or directory in %s on line %d +Warning: readfile(): Failed to open stream: No such file or directory in %s on line %d -- Filename: FALSE -- ValueError: Path must not be empty @@ -58,7 +58,7 @@ ValueError: Path must not be empty -- Filename: " " -- -Warning: readfile( ): Failed to open stream: Permission denied in %s on line %d +Warning: readfile(): Failed to open stream: Permission denied in %s on line %d -- Filename: \0 -- ValueError: readfile(): Argument #1 ($filename) must not contain any null bytes @@ -68,8 +68,8 @@ TypeError: readfile(): Argument #1 ($filename) must be of type string, array giv -- Filename: /no/such/file/dir -- -Warning: readfile(/no/such/file/dir): Failed to open stream: No such file or directory in %s on line %d +Warning: readfile(): Failed to open stream: No such file or directory in %s on line %d -- Filename: php/php -- -Warning: readfile(php/php): Failed to open stream: No such file or directory in %s on line %d +Warning: readfile(): Failed to open stream: No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/readfile_variation10.phpt b/ext/standard/tests/file/readfile_variation10.phpt index d2875215e5f7..3782f7384515 100644 --- a/ext/standard/tests/file/readfile_variation10.phpt +++ b/ext/standard/tests/file/readfile_variation10.phpt @@ -44,22 +44,22 @@ for( $i=0; $i bool(true) @@ -70,11 +70,11 @@ array(7) { } NULL -Warning: fopen(data://;base64): Failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d +Warning: fopen(): Failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d -Warning: fopen(data://foo,): Failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d +Warning: fopen(): Failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d -Warning: fopen(data://foo=bar,): Failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d +Warning: fopen(): Failed to open stream: rfc2397: illegal media type in %sstream_rfc2397_002.php on line %d array(8) { ["mediatype"]=> string(10) "text/plain" @@ -95,7 +95,7 @@ array(8) { } NULL -Warning: fopen(data://text/plain;foo,): Failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d +Warning: fopen(): Failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d array(9) { ["mediatype"]=> string(10) "text/plain" @@ -118,7 +118,7 @@ array(9) { } string(3) "bar" -Warning: fopen(data://text/plain;foo=bar;bla,): Failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d +Warning: fopen(): Failed to open stream: rfc2397: illegal parameter in %sstream_rfc2397_002.php on line %d array(9) { ["mediatype"]=> string(10) "text/plain" @@ -141,7 +141,7 @@ array(9) { } string(3) "bar" -Warning: fopen(data://text/plain;foo=bar;bar=baz): Failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d +Warning: fopen(): Failed to open stream: rfc2397: no comma in URL in %sstream_rfc2397_002.php on line %d array(10) { ["mediatype"]=> string(10) "text/plain" diff --git a/ext/standard/tests/file/stream_rfc2397_006.phpt b/ext/standard/tests/file/stream_rfc2397_006.phpt index 649c94d6da65..bde1d4e0cebe 100644 --- a/ext/standard/tests/file/stream_rfc2397_006.phpt +++ b/ext/standard/tests/file/stream_rfc2397_006.phpt @@ -26,8 +26,8 @@ foreach($streams as $stream) file_get_contents(): Argument #1 ($filename) must not contain any null bytes file_get_contents(): Argument #1 ($filename) must not contain any null bytes -Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhcg==): Failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d +Warning: file_get_contents(): Failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d bool(false) -Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhc=): Failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d +Warning: file_get_contents(): Failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d bool(false) diff --git a/ext/standard/tests/general_functions/bug44295-win.phpt b/ext/standard/tests/general_functions/bug44295-win.phpt index fd014cf9e9ac..223e0c24a10c 100644 --- a/ext/standard/tests/general_functions/bug44295-win.phpt +++ b/ext/standard/tests/general_functions/bug44295-win.phpt @@ -25,5 +25,5 @@ try { --EXPECT-- before -in catch: DirectoryIterator::__construct(c:\not\exists\here): Failed to open directory: No such file or directory +in catch: DirectoryIterator::__construct(): Failed to open directory: No such file or directory ==DONE== diff --git a/ext/standard/tests/general_functions/bug44295.phpt b/ext/standard/tests/general_functions/bug44295.phpt index 12cfb819a42b..131f6496b7b4 100644 --- a/ext/standard/tests/general_functions/bug44295.phpt +++ b/ext/standard/tests/general_functions/bug44295.phpt @@ -25,5 +25,5 @@ try { --EXPECT-- before -in catch: DirectoryIterator::__construct(/this/path/does/not/exist): Failed to open directory: No such file or directory +in catch: DirectoryIterator::__construct(): Failed to open directory: No such file or directory ==DONE== diff --git a/ext/standard/tests/general_functions/parse_ini_file.phpt b/ext/standard/tests/general_functions/parse_ini_file.phpt index ff0f9f2e6f10..b5bc4daac882 100644 --- a/ext/standard/tests/general_functions/parse_ini_file.phpt +++ b/ext/standard/tests/general_functions/parse_ini_file.phpt @@ -117,10 +117,10 @@ var_dump(parse_ini_file($filename, true)); echo "Done\n"; ?> --EXPECTF-- -Warning: parse_ini_file(%sparse_ini_file.dat): Failed to open stream: No such file or directory in %sparse_ini_file.php on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %sparse_ini_file.php on line %d bool(false) -Warning: parse_ini_file(%sparse_ini_file.dat): Failed to open stream: No such file or directory in %sparse_ini_file.php on line %d +Warning: parse_ini_file(): Failed to open stream: No such file or directory in %sparse_ini_file.php on line %d bool(false) array(1) { ["test"]=> diff --git a/ext/standard/tests/general_functions/proc_open_pipes3.phpt b/ext/standard/tests/general_functions/proc_open_pipes3.phpt index 1ee42904a058..8f065401eb14 100644 --- a/ext/standard/tests/general_functions/proc_open_pipes3.phpt +++ b/ext/standard/tests/general_functions/proc_open_pipes3.phpt @@ -45,7 +45,7 @@ array(4) { resource(%d) of type (Unknown) } -Warning: proc_open(test): Failed to open stream: %s in %s on line %d +Warning: proc_open(): Failed to open stream: %s in %s on line %d array(4) { [3]=> resource(%d) of type (Unknown) diff --git a/ext/standard/tests/http/bug38802.phpt b/ext/standard/tests/http/bug38802.phpt index e3eea5ee652a..8461560b59da 100644 --- a/ext/standard/tests/http/bug38802.phpt +++ b/ext/standard/tests/http/bug38802.phpt @@ -109,7 +109,7 @@ Connection: close " -- Test: fail after 2 redirections -- -Warning: fopen(http://%s:%d/foo/bar): Failed to open stream: Redirection limit reached, aborting in %s +Warning: fopen(): Failed to open stream: Redirection limit reached, aborting in %s bool(false) string(%d) "GET /foo/bar HTTP/1.1 Host: %s:%d @@ -122,7 +122,7 @@ Connection: close " -- Test: fail at first redirection -- -Warning: fopen(http://%s:%d/foo/bar): Failed to open stream: Redirection limit reached, aborting in %s +Warning: fopen(): Failed to open stream: Redirection limit reached, aborting in %s bool(false) string(%d) "GET /foo/bar HTTP/1.1 Host: %s:%d @@ -131,7 +131,7 @@ Connection: close " -- Test: fail at first redirection (2) -- -Warning: fopen(http://%s:%d/foo/bar): Failed to open stream: Redirection limit reached, aborting in %s +Warning: fopen(): Failed to open stream: Redirection limit reached, aborting in %s bool(false) string(%d) "GET /foo/bar HTTP/1.1 Host: %s:%d diff --git a/ext/standard/tests/http/bug47021.phpt b/ext/standard/tests/http/bug47021.phpt index 168721f4ec1b..d3237f5862ed 100644 --- a/ext/standard/tests/http/bug47021.phpt +++ b/ext/standard/tests/http/bug47021.phpt @@ -75,22 +75,22 @@ echo "\n"; Type='text/plain' Hello -Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP invalid response format (no colon in header line)! in %s +Warning: file_get_contents(): Failed to open stream: HTTP invalid response format (no colon in header line)! in %s Type='text/plain' Hello -Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP invalid response format (no colon in header line)! in %s +Warning: file_get_contents(): Failed to open stream: HTTP invalid response format (no colon in header line)! in %s Type='text/plain' Hello -Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP invalid response format (no colon in header line)! in %s +Warning: file_get_contents(): Failed to open stream: HTTP invalid response format (no colon in header line)! in %s Type='text/plain' Hello -Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP invalid response format (no colon in header line)! in %s +Warning: file_get_contents(): Failed to open stream: HTTP invalid response format (no colon in header line)! in %s diff --git a/ext/standard/tests/http/bug60570.phpt b/ext/standard/tests/http/bug60570.phpt index 7b62bdaf0b3c..d6d1bcf7a7d9 100644 --- a/ext/standard/tests/http/bug60570.phpt +++ b/ext/standard/tests/http/bug60570.phpt @@ -39,13 +39,13 @@ function do_test() { do_test(); ?> --EXPECTF-- -Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found +Warning: file_get_contents(): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in %s on line %d -Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found +Warning: file_get_contents(): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in %s on line %d -Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found +Warning: file_get_contents(): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in %s on line %d leak? penultimate iteration: %d, last one: %d bool(true) diff --git a/ext/standard/tests/http/bug69337.phpt b/ext/standard/tests/http/bug69337.phpt index 051108a09488..533a21b5bdbc 100644 --- a/ext/standard/tests/http/bug69337.phpt +++ b/ext/standard/tests/http/bug69337.phpt @@ -33,5 +33,5 @@ http_server_kill($pid); var_dump($f); ?> --EXPECTF-- -Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found%ain %s on line %d +Warning: file_get_contents(): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found%ain %s on line %d bool(false) diff --git a/ext/standard/tests/http/bug76342.phpt b/ext/standard/tests/http/bug76342.phpt index f1464417f98a..d8f733113ba6 100644 --- a/ext/standard/tests/http/bug76342.phpt +++ b/ext/standard/tests/http/bug76342.phpt @@ -31,5 +31,5 @@ http_server_kill($pid); ?> DONE --EXPECTF-- -Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! in %s on line %d +Warning: file_get_contents(): Failed to open stream: HTTP request failed! in %s on line %d DONE diff --git a/ext/standard/tests/http/gh16810.phpt b/ext/standard/tests/http/gh16810.phpt index 6feab1fb01f8..e17440c95efc 100644 --- a/ext/standard/tests/http/gh16810.phpt +++ b/ext/standard/tests/http/gh16810.phpt @@ -29,5 +29,5 @@ var_dump(fopen($uri, "r", false, $ctx)); --EXPECTF-- resource(%d) of type (stream) -Warning: fopen(http://%s): Failed to open stream: timeout must be lower than %d in %s on line %d +Warning: fopen(): Failed to open stream: timeout must be lower than %d in %s on line %d bool(false) diff --git a/ext/standard/tests/http/ghsa-52jp-hrpf-2jff-001.phpt b/ext/standard/tests/http/ghsa-52jp-hrpf-2jff-001.phpt index 73e1408c370b..a8786d15a6de 100644 --- a/ext/standard/tests/http/ghsa-52jp-hrpf-2jff-001.phpt +++ b/ext/standard/tests/http/ghsa-52jp-hrpf-2jff-001.phpt @@ -46,7 +46,7 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); Found the mime-type: text/html; Redirected: string(8000) "%s" -Warning: file_get_contents(http://127.0.0.1:%d): Failed to open stream: %s +Warning: file_get_contents(): Failed to open stream: %s string(0) "" array(3) { [0]=> diff --git a/ext/standard/tests/http/ghsa-52jp-hrpf-2jff-002.phpt b/ext/standard/tests/http/ghsa-52jp-hrpf-2jff-002.phpt index cde5aff0afe1..b6df1099a097 100644 --- a/ext/standard/tests/http/ghsa-52jp-hrpf-2jff-002.phpt +++ b/ext/standard/tests/http/ghsa-52jp-hrpf-2jff-002.phpt @@ -45,7 +45,7 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); --EXPECTF-- Found the mime-type: text/html; -Warning: file_get_contents(http://127.0.0.1:%d): Failed to open stream: HTTP Location header size is over the limit of 8182 bytes in %s +Warning: file_get_contents(): Failed to open stream: HTTP Location header size is over the limit of 8182 bytes in %s string(0) "" array(2) { [0]=> diff --git a/ext/standard/tests/http/ghsa-c5f2-jwm7-mmq2.phpt b/ext/standard/tests/http/ghsa-c5f2-jwm7-mmq2.phpt index e7dd194dbbe6..9542511d68a4 100644 --- a/ext/standard/tests/http/ghsa-c5f2-jwm7-mmq2.phpt +++ b/ext/standard/tests/http/ghsa-c5f2-jwm7-mmq2.phpt @@ -19,10 +19,4 @@ $context = stream_context_create(['http' => ['proxy' => 'tcp://' . $host, 'reque echo file_get_contents("http://$host/$userinput", false, $context); ?> --EXPECTF-- -Warning: file_get_contents(http://localhost:%d/index.php HTTP/1.1 -Host: localhost:%d - -GET /index2.php HTTP/1.1 -Host: localhost:%d - -GET /index.php): Failed to open stream: HTTP wrapper full URI path does not allow CR or LF characters in %s on line %d +Warning: file_get_contents(): Failed to open stream: HTTP wrapper full URI path does not allow CR or LF characters in %s on line %d diff --git a/ext/standard/tests/http/ghsa-pcmh-g36c-qc44-001.phpt b/ext/standard/tests/http/ghsa-pcmh-g36c-qc44-001.phpt index 471f44745ed3..83363fbbcc2f 100644 --- a/ext/standard/tests/http/ghsa-pcmh-g36c-qc44-001.phpt +++ b/ext/standard/tests/http/ghsa-pcmh-g36c-qc44-001.phpt @@ -41,7 +41,7 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); --EXPECTF-- Found the mime-type: text/html -Warning: file_get_contents(http://127.0.0.1:%d): Failed to open stream: HTTP invalid response format (no colon in header line)! in %s +Warning: file_get_contents(): Failed to open stream: HTTP invalid response format (no colon in header line)! in %s bool(false) array(2) { [0]=> diff --git a/ext/standard/tests/http/ghsa-pcmh-g36c-qc44-002.phpt b/ext/standard/tests/http/ghsa-pcmh-g36c-qc44-002.phpt index 67ce5517ce3c..db89ebb1d9ec 100644 --- a/ext/standard/tests/http/ghsa-pcmh-g36c-qc44-002.phpt +++ b/ext/standard/tests/http/ghsa-pcmh-g36c-qc44-002.phpt @@ -41,7 +41,7 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); --EXPECTF-- Found the mime-type: text/html -Warning: file_get_contents(http://127.0.0.1:%d): Failed to open stream: HTTP invalid response format (space in header name)! in %s +Warning: file_get_contents(): Failed to open stream: HTTP invalid response format (space in header name)! in %s bool(false) array(2) { [0]=> diff --git a/ext/standard/tests/http/ghsa-v8xr-gpvj-cx9g-004.phpt b/ext/standard/tests/http/ghsa-v8xr-gpvj-cx9g-004.phpt index e6382420954f..358a85ce0f71 100644 --- a/ext/standard/tests/http/ghsa-v8xr-gpvj-cx9g-004.phpt +++ b/ext/standard/tests/http/ghsa-v8xr-gpvj-cx9g-004.phpt @@ -40,7 +40,7 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECTF-- -Warning: file_get_contents(http://127.0.0.1:%d): Failed to open stream: HTTP invalid response format (folding header at the start)! in %s +Warning: file_get_contents(): Failed to open stream: HTTP invalid response format (folding header at the start)! in %s bool(false) array(1) { [0]=> diff --git a/ext/standard/tests/http/ghsa-v8xr-gpvj-cx9g-005.phpt b/ext/standard/tests/http/ghsa-v8xr-gpvj-cx9g-005.phpt index c0ee01671460..457681ab2947 100644 --- a/ext/standard/tests/http/ghsa-v8xr-gpvj-cx9g-005.phpt +++ b/ext/standard/tests/http/ghsa-v8xr-gpvj-cx9g-005.phpt @@ -40,7 +40,7 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECTF-- -Warning: file_get_contents(http://127.0.0.1:%d): Failed to open stream: HTTP invalid header name (cannot start with CR character)! in %s +Warning: file_get_contents(): Failed to open stream: HTTP invalid header name (cannot start with CR character)! in %s bool(false) array(1) { [0]=> diff --git a/ext/standard/tests/http/http_response_header_03.phpt b/ext/standard/tests/http/http_response_header_03.phpt index 5bddc304c724..bdd5c69aba56 100644 --- a/ext/standard/tests/http/http_response_header_03.phpt +++ b/ext/standard/tests/http/http_response_header_03.phpt @@ -30,7 +30,7 @@ http_server_kill($pid); Deprecated: The predefined locally scoped $http_response_header variable is deprecated, call http_get_last_response_headers() instead in %s on line 16 NULL -Warning: file_get_contents(http://%s:%d): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found%a +Warning: file_get_contents(): Failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found%a bool(false) array(5) { [0]=> diff --git a/ext/standard/tests/http/ignore_errors.phpt b/ext/standard/tests/http/ignore_errors.phpt index 9cd8cdc4509f..86a68e406897 100644 --- a/ext/standard/tests/http/ignore_errors.phpt +++ b/ext/standard/tests/http/ignore_errors.phpt @@ -68,7 +68,7 @@ Connection: close " -Warning: fopen(http://%s:%d/foo/bar): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not found +Warning: fopen(): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not found in %s on line %d bool(false) string(%d) "GET /foo/bar HTTP/1.1 diff --git a/ext/standard/tests/image/getimagesize_variation3.phpt b/ext/standard/tests/image/getimagesize_variation3.phpt index f6317db74058..7e848603e5da 100644 --- a/ext/standard/tests/image/getimagesize_variation3.phpt +++ b/ext/standard/tests/image/getimagesize_variation3.phpt @@ -43,10 +43,10 @@ array(0) { -- Non-existent file (nofile.ext) -- -Warning: getimagesize(%snofile.ext): Failed to open stream: No such file or directory in %s on line %d +Warning: getimagesize(): Failed to open stream: No such file or directory in %s on line %d bool(false) -Warning: getimagesize(%snofile.ext): Failed to open stream: No such file or directory in %s on line %d +Warning: getimagesize(): Failed to open stream: No such file or directory in %s on line %d bool(false) array(0) { } diff --git a/ext/standard/tests/mail/gh7875.phpt b/ext/standard/tests/mail/gh7875.phpt index 0a1a15ac1160..1f8346a0715d 100644 --- a/ext/standard/tests/mail/gh7875.phpt +++ b/ext/standard/tests/mail/gh7875.phpt @@ -46,5 +46,5 @@ try { @unlink(__DIR__ . "/gh7875.mail.out"); ?> --EXPECTF-- -mail(%s): Failed to open stream: Permission denied +mail(): Failed to open stream: Permission denied bool(false) diff --git a/ext/standard/tests/streams/bug72771.phpt b/ext/standard/tests/streams/bug72771.phpt index 59eff72ad049..a8c5daf4b121 100644 --- a/ext/standard/tests/streams/bug72771.phpt +++ b/ext/standard/tests/streams/bug72771.phpt @@ -18,5 +18,5 @@ $ds=opendir($path, $context); var_dump($ds); ?> --EXPECTF-- -Warning: opendir(ftps://127.0.0.1:%d/): Failed to open directory: Server doesn't support FTPS. in %s on line %d +Warning: opendir(): Failed to open directory: Server doesn't support FTPS. in %s on line %d bool(false) diff --git a/ext/standard/tests/streams/bug73457.phpt b/ext/standard/tests/streams/bug73457.phpt index 64b8bf6ac8ed..f46a774484db 100644 --- a/ext/standard/tests/streams/bug73457.phpt +++ b/ext/standard/tests/streams/bug73457.phpt @@ -19,5 +19,5 @@ $ds=file_get_contents($path); var_dump($ds); ?> --EXPECTF-- -Warning: file_get_contents(ftp://127.0.0.1:%d/bug73457): Failed to open stream: Failed to set up data channel: %s in %s on line %d +Warning: file_get_contents(): Failed to open stream: Failed to set up data channel: %s in %s on line %d bool(false) diff --git a/ext/standard/tests/streams/bug74951.phpt b/ext/standard/tests/streams/bug74951.phpt index 43d4f46bfbf6..b30b5fe2824e 100644 --- a/ext/standard/tests/streams/bug74951.phpt +++ b/ext/standard/tests/streams/bug74951.phpt @@ -10,4 +10,4 @@ stream_wrapper_register('e0ploit','Stream00ploiter'); $s=fopen('e0ploit://',0); ?> --EXPECTF-- -Warning: fopen(e0ploit://): Failed to open stream: operation failed in %s%ebug74951.php on line 7 +Warning: fopen(): Failed to open stream: operation failed in %s%ebug74951.php on line 7 diff --git a/ext/standard/tests/streams/glob-wrapper.phpt b/ext/standard/tests/streams/glob-wrapper.phpt index 9be0fce6b710..6f5519c60be7 100644 --- a/ext/standard/tests/streams/glob-wrapper.phpt +++ b/ext/standard/tests/streams/glob-wrapper.phpt @@ -27,7 +27,7 @@ foreach ( [ __DIR__, "glob://".__DIR__ ] as $spec) { Warning: opendir(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (/does_not_exist) in %s%eglob-wrapper.php on line 5 -Warning: opendir(%s): Failed to open directory: %r(Operation not permitted|Insufficient privileges)%r in %s%eglob-wrapper.php on line 5 +Warning: opendir(): Failed to open directory: %r(Operation not permitted|Insufficient privileges)%r in %s%eglob-wrapper.php on line 5 Failed to open %s ** Opening glob://%s No files in glob://%s diff --git a/ext/standard/tests/streams/opendir-001.phpt b/ext/standard/tests/streams/opendir-001.phpt index 7fa9bbfd7b13..c5459f0ab477 100644 --- a/ext/standard/tests/streams/opendir-001.phpt +++ b/ext/standard/tests/streams/opendir-001.phpt @@ -15,6 +15,6 @@ $path="ftp://localhost:" . $port."/bogusdir"; var_dump(opendir($path)); ?> --EXPECTF-- -Warning: opendir(ftp://localhost:%d/bogusdir): Failed to open directory: FTP server reports 250 /bogusdir: No such file or directory +Warning: opendir(): Failed to open directory: FTP server reports 250 /bogusdir: No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/streams/opendir-003.phpt b/ext/standard/tests/streams/opendir-003.phpt index d79d43b1f12e..51676b8dcfee 100644 --- a/ext/standard/tests/streams/opendir-003.phpt +++ b/ext/standard/tests/streams/opendir-003.phpt @@ -20,6 +20,6 @@ $context = stream_context_create(array('ssl' => array('cafile' => __DIR__ . '/. var_dump(opendir($path, $context)); ?> --EXPECTF-- -Warning: opendir(ftps://127.0.0.1:%d/bogusdir): Failed to open directory: FTP server reports 250 /bogusdir: No such file or directory +Warning: opendir(): Failed to open directory: FTP server reports 250 /bogusdir: No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/streams/stream_errors_error_has_code.phpt b/ext/standard/tests/streams/stream_errors_error_has_code.phpt index 6cd6b70411a6..b8bbe012c8ee 100644 --- a/ext/standard/tests/streams/stream_errors_error_has_code.phpt +++ b/ext/standard/tests/streams/stream_errors_error_has_code.phpt @@ -27,4 +27,4 @@ if ($error2) { ?> --EXPECT-- Got most recent error -Param contains 'nonexistent2': yes +Param contains 'nonexistent2': no diff --git a/ext/standard/tests/streams/stream_errors_invalid_types.phpt b/ext/standard/tests/streams/stream_errors_invalid_types.phpt index 1b3ab5e8931e..09a1d8f90e30 100644 --- a/ext/standard/tests/streams/stream_errors_invalid_types.phpt +++ b/ext/standard/tests/streams/stream_errors_invalid_types.phpt @@ -30,8 +30,8 @@ try { ?> --EXPECTF-- -Warning: fopen(php://nonexistent): Failed to open stream: operation failed in %s on line %d +Warning: fopen(): Failed to open stream: operation failed in %s on line %d Caught TypeError for error_mode -Warning: fopen(php://nonexistent): Failed to open stream: operation failed in %s on line %d +Warning: fopen(): Failed to open stream: operation failed in %s on line %d Caught TypeError for error_store diff --git a/ext/standard/tests/streams/stream_errors_silent_with_handler.phpt b/ext/standard/tests/streams/stream_errors_silent_with_handler.phpt index 456575affc3a..387939a1063a 100644 --- a/ext/standard/tests/streams/stream_errors_silent_with_handler.phpt +++ b/ext/standard/tests/streams/stream_errors_silent_with_handler.phpt @@ -32,6 +32,6 @@ Handler called Wrapper: PHP Code: OpenFailed Message: Failed to open stream: operation failed -Param: php://nonexistent +Param: null Terminating: yes bool(true) diff --git a/ext/standard/tests/streams/stream_errors_standard_error.phpt b/ext/standard/tests/streams/stream_errors_standard_error.phpt index 42de8cc3b17d..93b66b329d99 100644 --- a/ext/standard/tests/streams/stream_errors_standard_error.phpt +++ b/ext/standard/tests/streams/stream_errors_standard_error.phpt @@ -16,5 +16,5 @@ var_dump($stream); ?> --EXPECTF-- -Warning: fopen(php://nonexistent): Failed to open stream: %s in %s on line %d +Warning: fopen(): Failed to open stream: %s in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/006.phpt b/ext/standard/tests/strings/006.phpt index dabed24c5780..207afd7c5250 100644 --- a/ext/standard/tests/strings/006.phpt +++ b/ext/standard/tests/strings/006.phpt @@ -10,7 +10,7 @@ var_dump(ob_get_contents()); ?> --EXPECTF-- -Warning: highlight_file(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA): Failed to open stream: %s006.php on line %d +Warning: highlight_file(): Failed to open stream: %s006.php on line %d Warning: highlight_file(): Failed opening 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' for highlighting in %s006.php on line %d bool(false) diff --git a/ext/standard/tests/strings/007-win32.phpt b/ext/standard/tests/strings/007-win32.phpt index 9fe9e4821394..ce6a0bd7e4df 100644 --- a/ext/standard/tests/strings/007-win32.phpt +++ b/ext/standard/tests/strings/007-win32.phpt @@ -11,6 +11,6 @@ var_dump(ob_get_contents()); ?> --EXPECTF-- -Warning: php_strip_whitespace(%s): Failed to open stream: No such file or directory in %s on line %d +Warning: php_strip_whitespace(): Failed to open stream: No such file or directory in %s on line %d string(0) "" bool(false) diff --git a/ext/standard/tests/strings/007.phpt b/ext/standard/tests/strings/007.phpt index 69140715b450..5d3c4b045050 100644 --- a/ext/standard/tests/strings/007.phpt +++ b/ext/standard/tests/strings/007.phpt @@ -11,6 +11,6 @@ var_dump(ob_get_contents()); ?> --EXPECTF-- -Warning: php_strip_whitespace(%s): Failed to open stream: File%Sname too long in %s007.php on line %d +Warning: php_strip_whitespace(): Failed to open stream: File%Sname too long in %s007.php on line %d string(0) "" bool(false) diff --git a/ext/standard/tests/strings/bug68996.phpt b/ext/standard/tests/strings/bug68996.phpt index 95d7f9700101..4abb35801575 100644 --- a/ext/standard/tests/strings/bug68996.phpt +++ b/ext/standard/tests/strings/bug68996.phpt @@ -8,4 +8,4 @@ fopen("\xfc\x63", "r"); ?> --EXPECTF--
-Warning: fopen(�c): Failed to open stream: No such file or directory in %sbug68996.php on line 2
+Warning: fopen(): Failed to open stream: No such file or directory in %sbug68996.php on line 2
diff --git a/ext/standard/tests/strings/highlight_file.phpt b/ext/standard/tests/strings/highlight_file.phpt index 048399216c90..07983b79b61c 100644 --- a/ext/standard/tests/strings/highlight_file.phpt +++ b/ext/standard/tests/strings/highlight_file.phpt @@ -38,7 +38,7 @@ echo "Done\n"; --EXPECTF-- Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0 -Warning: highlight_file(%shighlight_file.dat): Failed to open stream: No such file or directory in %s on line %d +Warning: highlight_file(): Failed to open stream: No such file or directory in %s on line %d Warning: highlight_file(): Failed opening '%shighlight_file.dat' for highlighting in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/md5_file.phpt b/ext/standard/tests/strings/md5_file.phpt index 1eb9b2654ada..a6fba9ea0384 100644 --- a/ext/standard/tests/strings/md5_file.phpt +++ b/ext/standard/tests/strings/md5_file.phpt @@ -66,10 +66,10 @@ echo "\nDone"; *** Testing for error conditions *** Path must not be empty -Warning: md5_file(aZrq16u): Failed to open stream: No such file or directory in %s on line %d +Warning: md5_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -Warning: md5_file(12): Failed to open stream: No such file or directory in %s on line %d +Warning: md5_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) *** Hexadecimal Output for Empty file as Argument *** diff --git a/ext/standard/tests/strings/php_strip_whitespace.phpt b/ext/standard/tests/strings/php_strip_whitespace.phpt index 9f22daa9eb43..a3a811fe4889 100644 --- a/ext/standard/tests/strings/php_strip_whitespace.phpt +++ b/ext/standard/tests/strings/php_strip_whitespace.phpt @@ -39,7 +39,7 @@ var_dump(php_strip_whitespace($filename)); echo "Done\n"; ?> --EXPECTF-- -Warning: php_strip_whitespace(%sphp_strip_whitespace.dat): Failed to open stream: No such file or directory in %s on line %d +Warning: php_strip_whitespace(): Failed to open stream: No such file or directory in %s on line %d string(0) "" string(18) "/* test comment */" string(9) "" diff --git a/ext/standard/tests/strings/sha1.phpt b/ext/standard/tests/strings/sha1.phpt index 1fea3566b5f8..e88edb5acd97 100644 --- a/ext/standard/tests/strings/sha1.phpt +++ b/ext/standard/tests/strings/sha1.phpt @@ -47,5 +47,5 @@ bool(true) string(20) "%a" string(20) "%a" -Warning: sha1_file(%ssha1.dat): Failed to open stream: No such file or directory in %s on line %d +Warning: sha1_file(): Failed to open stream: No such file or directory in %s on line %d Done diff --git a/ext/standard/tests/strings/sha1_file.phpt b/ext/standard/tests/strings/sha1_file.phpt index 60d6ad808f8c..2014eabb98f5 100644 --- a/ext/standard/tests/strings/sha1_file.phpt +++ b/ext/standard/tests/strings/sha1_file.phpt @@ -78,12 +78,12 @@ Path must not be empty -- invalid filename -- -Warning: sha1_file(rewncwYcn89q): Failed to open stream: No such file or directory in %s on line %d +Warning: sha1_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- Scalar value as filename -- -Warning: sha1_file(12): Failed to open stream: No such file or directory in %s on line %d +Warning: sha1_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) -- NULL as filename -- diff --git a/ext/zend_test/tests/gh17797.phpt b/ext/zend_test/tests/gh17797.phpt index 271841b4389d..23bc217aef29 100644 --- a/ext/zend_test/tests/gh17797.phpt +++ b/ext/zend_test/tests/gh17797.phpt @@ -17,7 +17,7 @@ Warning: Undefined variable $c in %s on line %d Deprecated: zend_test_compile_string(): Passing null to parameter #3 ($position) of type int is deprecated in %s on line %d -Warning: require(sumfile.php): Failed to open stream: No such file or directory in on line %d diff --git a/ext/zend_test/tests/gh17899.phpt b/ext/zend_test/tests/gh17899.phpt index 184fe0b2aa39..58f445a3b7bf 100644 --- a/ext/zend_test/tests/gh17899.phpt +++ b/ext/zend_test/tests/gh17899.phpt @@ -19,7 +19,7 @@ Warning: Undefined variable $c in %s on line %d Deprecated: zend_test_compile_string(): Passing null to parameter #3 ($position) of type int is deprecated in %s on line %d -Warning: require(sumfile.php): Failed to open stream: No such file or directory in on line %d diff --git a/ext/zip/tests/bug53603.phpt b/ext/zip/tests/bug53603.phpt index 914b0b8440c6..ddffff393546 100644 --- a/ext/zip/tests/bug53603.phpt +++ b/ext/zip/tests/bug53603.phpt @@ -28,5 +28,5 @@ $a = $zip->extractTo('teststream://test'); var_dump($a); ?> --EXPECTF-- -Warning: ZipArchive::extractTo(teststream://test/foo): Failed to open stream: "TestStream::stream_open" is not implemented in %s on line %d +Warning: ZipArchive::extractTo(): Failed to open stream: "TestStream::stream_open" is not implemented in %s on line %d bool(false) diff --git a/ext/zip/tests/oo_encryption.phpt b/ext/zip/tests/oo_encryption.phpt index f5207e307599..448979b5e532 100644 --- a/ext/zip/tests/oo_encryption.phpt +++ b/ext/zip/tests/oo_encryption.phpt @@ -60,7 +60,7 @@ string(3) "bar" == Stream string(3) "foo" -Warning: file_get_contents(%s): Failed to open stream: operation failed in %s on line %d +Warning: file_get_contents(): Failed to open stream: operation failed in %s on line %d bool(false) string(3) "bar" == Done diff --git a/ext/zlib/tests/gzfile_variation7.phpt b/ext/zlib/tests/gzfile_variation7.phpt index ca221c12cff3..e95443ce267c 100644 --- a/ext/zlib/tests/gzfile_variation7.phpt +++ b/ext/zlib/tests/gzfile_variation7.phpt @@ -11,8 +11,8 @@ var_dump(gzfile($filename, false)); var_dump(gzfile($filename, true)); ?> --EXPECTF-- -Warning: gzfile(nonexistent_file_gzfile.txt.gz): Failed to open stream: No such file or directory in %s on line %d +Warning: gzfile(): Failed to open stream: No such file or directory in %s on line %d bool(false) -Warning: gzfile(nonexistent_file_gzfile.txt.gz): Failed to open stream: No such file or directory in %s on line %d +Warning: gzfile(): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/zlib/tests/gzopen_variation9.phpt b/ext/zlib/tests/gzopen_variation9.phpt index f9ac099dc253..0118dd3ea130 100644 --- a/ext/zlib/tests/gzopen_variation9.phpt +++ b/ext/zlib/tests/gzopen_variation9.phpt @@ -38,6 +38,6 @@ gzopen=bool(false) mode=e -Warning: gzopen(%s/test.txt.gz): Failed to open stream: %s in %s on line %d +Warning: gzopen(): Failed to open stream: %s in %s on line %d gzopen=bool(false) diff --git a/ext/zlib/tests/readgzfile_variation7.phpt b/ext/zlib/tests/readgzfile_variation7.phpt index 6f201abe2361..a90feb9b2009 100644 --- a/ext/zlib/tests/readgzfile_variation7.phpt +++ b/ext/zlib/tests/readgzfile_variation7.phpt @@ -10,8 +10,8 @@ var_dump(readgzfile($file, false)); var_dump(readgzfile($file, true)); ?> --EXPECTF-- -Warning: readgzfile(unknown_file.txt.gz): Failed to open stream: No such file or directory in %s on line %d +Warning: readgzfile(): Failed to open stream: No such file or directory in %s on line %d bool(false) -Warning: readgzfile(unknown_file.txt.gz): Failed to open stream: No such file or directory in %s on line %d +Warning: readgzfile(): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/zlib/tests/zlib_scheme_dir_basic.phpt b/ext/zlib/tests/zlib_scheme_dir_basic.phpt index 683e87b8eff4..c551e0684f9e 100644 --- a/ext/zlib/tests/zlib_scheme_dir_basic.phpt +++ b/ext/zlib/tests/zlib_scheme_dir_basic.phpt @@ -15,6 +15,6 @@ var_dump(rmdir($srcFile)); bool(false) bool(false) -Warning: opendir(compress.zlib://%s/dir.gz): Failed to open directory: not implemented in %s on line %d +Warning: opendir(): Failed to open directory: not implemented in %s on line %d bool(false) bool(false) diff --git a/main/streams/php_stream_errors.h b/main/streams/php_stream_errors.h index 438397a24ded..b21f47505248 100644 --- a/main/streams/php_stream_errors.h +++ b/main/streams/php_stream_errors.h @@ -141,11 +141,11 @@ PHPAPI void php_stream_wrapper_log_error(const php_stream_wrapper *wrapper, ZEND_ATTRIBUTE_FORMAT(printf, 7, 8); PHPAPI void php_stream_display_wrapper_name_errors(const char *wrapper_name, - php_stream_context *context, zend_enum_StreamErrorCode code, const char *path, + php_stream_context *context, zend_enum_StreamErrorCode code, const char *caption); PHPAPI void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, - php_stream_context *context, zend_enum_StreamErrorCode code, const char *path, + php_stream_context *context, zend_enum_StreamErrorCode code, const char *caption); PHPAPI void php_stream_tidy_wrapper_name_error_log(const char *wrapper_name); diff --git a/main/streams/stream_errors.c b/main/streams/stream_errors.c index 70c06b70182a..2fa2cc646636 100644 --- a/main/streams/stream_errors.c +++ b/main/streams/stream_errors.c @@ -723,7 +723,7 @@ static zend_llist *php_stream_get_wrapper_errors_list(const char *wrapper_name) } PHPAPI void php_stream_display_wrapper_name_errors(const char *wrapper_name, - php_stream_context *context, zend_enum_StreamErrorCode code, const char *path, + php_stream_context *context, zend_enum_StreamErrorCode code, const char *caption) { char *msg; @@ -734,7 +734,6 @@ PHPAPI void php_stream_display_wrapper_name_errors(const char *wrapper_name, return; } - char *tmp = estrdup(path); if (strcmp(wrapper_name, PHP_STREAM_ERROR_WRAPPER_DEFAULT_NAME)) { zend_llist *err_list = php_stream_get_wrapper_errors_list(wrapper_name); if (err_list) { @@ -783,12 +782,10 @@ PHPAPI void php_stream_display_wrapper_name_errors(const char *wrapper_name, msg = "no suitable wrapper could be found"; } - php_strip_url_passwd(tmp); - zend_string *message = strpprintf(0, "%s: %s", caption, msg); php_stream_wrapper_error_internal(wrapper_name, context, NULL, REPORT_ERRORS, E_WARNING, true, - code, tmp, message); + code, NULL, message); if (free_msg) { efree(msg); @@ -796,12 +793,12 @@ PHPAPI void php_stream_display_wrapper_name_errors(const char *wrapper_name, } PHPAPI void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, - php_stream_context *context, zend_enum_StreamErrorCode code, const char *path, + php_stream_context *context, zend_enum_StreamErrorCode code, const char *caption) { if (wrapper) { const char *wrapper_name = PHP_STREAM_ERROR_WRAPPER_NAME(wrapper); - php_stream_display_wrapper_name_errors(wrapper_name, context, code, path, caption); + php_stream_display_wrapper_name_errors(wrapper_name, context, code, caption); } } diff --git a/main/streams/streams.c b/main/streams/streams.c index c3bde0a8b109..453c61b56a29 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -2148,7 +2148,7 @@ PHPAPI php_stream *_php_stream_opendir(const char *path, int options, } if (stream == NULL && (options & REPORT_ERRORS)) { php_stream_display_wrapper_errors(wrapper, context, PHP_STREAM_EC(OpenFailed), - path, "Failed to open directory"); + "Failed to open directory"); } php_stream_tidy_wrapper_error_log(wrapper); @@ -2323,7 +2323,7 @@ PHPAPI php_stream *_php_stream_open_wrapper_ex(const char *path, const char *mod if (stream == NULL && (options & REPORT_ERRORS)) { php_stream_display_wrapper_name_errors(wrapper_name, context, PHP_STREAM_EC(OpenFailed), - path, "Failed to open stream"); + "Failed to open stream"); if (opened_path && *opened_path) { zend_string_release_ex(*opened_path, 0); *opened_path = NULL; diff --git a/sapi/cli/tests/bug69655.phpt b/sapi/cli/tests/bug69655.phpt index 4ab53bcbaae0..d13f67f5f12e 100644 --- a/sapi/cli/tests/bug69655.phpt +++ b/sapi/cli/tests/bug69655.phpt @@ -17,11 +17,11 @@ foreach (['MKCO', 'MKCOLL', 'M'] as $method) { } ?> --EXPECTF-- -Warning: file_get_contents(http://localhost:%d): Failed to open stream: HTTP request failed! HTTP/1.1 501 Not Implemented +Warning: file_get_contents(): Failed to open stream: HTTP request failed! HTTP/1.1 501 Not Implemented in %s on line %d -Warning: file_get_contents(http://localhost:%d): Failed to open stream: HTTP request failed! HTTP/1.1 501 Not Implemented +Warning: file_get_contents(): Failed to open stream: HTTP request failed! HTTP/1.1 501 Not Implemented in %s on line %d -Warning: file_get_contents(http://localhost:%d): Failed to open stream: HTTP request failed! HTTP/1.1 501 Not Implemented +Warning: file_get_contents(): Failed to open stream: HTTP request failed! HTTP/1.1 501 Not Implemented in %s on line %d diff --git a/sapi/cli/tests/bug70264.phpt b/sapi/cli/tests/bug70264.phpt index e1b0ee8fe8b1..4de5b72ffb05 100644 --- a/sapi/cli/tests/bug70264.phpt +++ b/sapi/cli/tests/bug70264.phpt @@ -14,8 +14,8 @@ echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/..\\CREDITS"); echo file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "/..%5CCREDITS"); ?> --EXPECTF-- -Warning: file_get_contents(http://%s/..\CREDITS): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found +Warning: file_get_contents(): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in %sbug70264.php on line %d -Warning: file_get_contents(http://%s/..%5CCREDITS): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found +Warning: file_get_contents(): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in %sbug70264.php on line %d diff --git a/sapi/cli/tests/bug73630a.phpt b/sapi/cli/tests/bug73630a.phpt index 45880c6cda09..33576a9e2b11 100644 --- a/sapi/cli/tests/bug73630a.phpt +++ b/sapi/cli/tests/bug73630a.phpt @@ -21,5 +21,5 @@ $path = "/" . str_repeat("x", 16400) . "//example.com"; var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS . "$path")); ?> --EXPECTF-- -Warning: file_get_contents(http://%s//example.com): Failed to open stream: HTTP request failed! in %s on line %d +Warning: file_get_contents(): Failed to open stream: HTTP request failed! in %s on line %d bool(false) diff --git a/sapi/phpdbg/tests/bug78297.phpt b/sapi/phpdbg/tests/bug78297.phpt index 196736bb0037..52552ee17c96 100644 --- a/sapi/phpdbg/tests/bug78297.phpt +++ b/sapi/phpdbg/tests/bug78297.phpt @@ -10,7 +10,7 @@ include "does_not_exist.php"; --EXPECTF-- [Successful compilation of %s] prompt> -Warning: include(%s): Failed to open stream: No such file or directory in %s on line %d +Warning: include(): Failed to open stream: No such file or directory in %s on line %d Warning: include(): Failed opening 'does_not_exist.php' for inclusion (include_path=%s) in %s on line %d [Script ended normally] diff --git a/tests/lang/bug28213.phpt b/tests/lang/bug28213.phpt index abd965cbb935..1b75a6694413 100644 --- a/tests/lang/bug28213.phpt +++ b/tests/lang/bug28213.phpt @@ -7,7 +7,7 @@ set_error_handler(array('FooBar', 'error')); include('foobar.php'); ?> --EXPECTF-- -#0 %s(%d): FooBar::error(2, 'include(foobar....', '%s', 4) +#0 %s(%d): FooBar::error(2, 'include(): Fail...', '%s', 4) #1 %s(%d): include() #0 %s(%d): FooBar::error(2, 'include(): Fail...', '%s', 4) #1 %s(%d): include() diff --git a/tests/lang/bug35176.phpt b/tests/lang/bug35176.phpt index 67c9324edd81..926f788de054 100644 --- a/tests/lang/bug35176.phpt +++ b/tests/lang/bug35176.phpt @@ -10,7 +10,7 @@ require_once('nonexistent.php'); ?> --EXPECTF--
-Warning: require_once(nonexistent.php) [function.require-once.html]: Failed to open stream: No such file or directory in %sbug35176.php on line 2
+Warning: require_once() [function.require-once.html]: Failed to open stream: No such file or directory in %sbug35176.php on line 2

Fatal error: Uncaught Error: Failed opening required 'nonexistent.php' (include_path='%s') in %s:%d Stack trace: diff --git a/tests/lang/bug43958.phpt b/tests/lang/bug43958.phpt index 7f0c1b7487a2..47fa7f27623c 100644 --- a/tests/lang/bug43958.phpt +++ b/tests/lang/bug43958.phpt @@ -12,6 +12,6 @@ class MyClass MyClass::loadCode('file-which-does-not-exist-on-purpose.php'); ?> --EXPECTF-- -Warning: include(file-which-does-not-exist-on-purpose.php): Failed to open stream: No such file or directory in %sbug43958.php on line 5 +Warning: include(): Failed to open stream: No such file or directory in %sbug43958.php on line 5 Warning: include(): Failed opening 'file-which-does-not-exist-on-purpose.php' for inclusion (include_path='%s') in %sbug43958.php on line 5 diff --git a/tests/output/bug75236.phpt b/tests/output/bug75236.phpt index bee4732cb2c0..ac41721fddc4 100644 --- a/tests/output/bug75236.phpt +++ b/tests/output/bug75236.phpt @@ -14,5 +14,5 @@ Bug #75236: infinite loop when printing an error-message --EXPECTF-- before getfilecontent
-Warning: file_get_contents(no/suchfile): Failed to open stream: No such file or directory in %s on line 7
+Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line 7
after getfilecontent diff --git a/tests/security/open_basedir_copy.phpt b/tests/security/open_basedir_copy.phpt index 82806b8fb822..3282d1f42890 100644 --- a/tests/security/open_basedir_copy.phpt +++ b/tests/security/open_basedir_copy.phpt @@ -35,42 +35,42 @@ bool(true) Warning: copy(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(../bad): Failed to open stream: %s in %s on line %d +Warning: copy(): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(../bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: copy(): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(..): Failed to open stream: %s in %s on line %d +Warning: copy(): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(../): Failed to open stream: %s in %s on line %d +Warning: copy(): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(/): Failed to open stream: %s in %s on line %d +Warning: copy(): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(../bad/.): Failed to open stream: %s in %s on line %d +Warning: copy(): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(../bad/./bad.txt): Failed to open stream: %s in %s on line %d +Warning: copy(): Failed to open stream: %s in %s on line %d bool(false) Warning: copy(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -Warning: copy(./../.): Failed to open stream: %s in %s on line %d +Warning: copy(): Failed to open stream: %s in %s on line %d bool(false) bool(true) bool(true) diff --git a/tests/security/open_basedir_dir.phpt b/tests/security/open_basedir_dir.phpt index 10181c3efa74..0e5a3eff627b 100644 --- a/tests/security/open_basedir_dir.phpt +++ b/tests/security/open_basedir_dir.phpt @@ -30,42 +30,42 @@ bool(true) Warning: dir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(../bad): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(../bad/bad.txt): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(..): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(../): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(/): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(../bad/.): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(%s/test/bad/bad.txt): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) Warning: dir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: dir(%s/test/bad/../bad/bad.txt): Failed to open directory: %s in %s on line %d +Warning: dir(): Failed to open directory: %s in %s on line %d bool(false) object(Directory)#%d (2) { ["path"]=> diff --git a/tests/security/open_basedir_error_log_variation.phpt b/tests/security/open_basedir_error_log_variation.phpt index 4a7b14b00445..bbbb307ff24f 100644 --- a/tests/security/open_basedir_error_log_variation.phpt +++ b/tests/security/open_basedir_error_log_variation.phpt @@ -32,17 +32,17 @@ bool(true) Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: error_log(%s/test/bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: error_log(): Failed to open stream: %s in %s on line %d bool(false) Warning: error_log(): open_basedir restriction in effect. File(%s/test/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: error_log(%s/test/bad.txt): Failed to open stream: %s in %s on line %d +Warning: error_log(): Failed to open stream: %s in %s on line %d bool(false) Warning: error_log(): open_basedir restriction in effect. File(%s/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: error_log(%s/bad.txt): Failed to open stream: %s in %s on line %d +Warning: error_log(): Failed to open stream: %s in %s on line %d bool(false) bool(true) *** Finished testing open_basedir configuration [error_log] *** diff --git a/tests/security/open_basedir_file.phpt b/tests/security/open_basedir_file.phpt index e3d2a5d8a6f9..24bec56a9a1c 100644 --- a/tests/security/open_basedir_file.phpt +++ b/tests/security/open_basedir_file.phpt @@ -31,42 +31,42 @@ bool(true) Warning: file(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: file(../bad): Failed to open stream: %s in %s on line %d +Warning: file(): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file(../bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: file(): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: file(..): Failed to open stream: %s in %s on line %d +Warning: file(): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: file(../): Failed to open stream: %s in %s on line %d +Warning: file(): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: file(/): Failed to open stream: %s in %s on line %d +Warning: file(): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: file(../bad/.): Failed to open stream: %s in %s on line %d +Warning: file(): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file(%s/test/bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: file(): Failed to open stream: %s in %s on line %d bool(false) Warning: file(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file(%s/test/bad/../bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: file(): Failed to open stream: %s in %s on line %d bool(false) array(1) { [0]=> diff --git a/tests/security/open_basedir_file_get_contents.phpt b/tests/security/open_basedir_file_get_contents.phpt index 91a3eb09804b..c017dc835786 100644 --- a/tests/security/open_basedir_file_get_contents.phpt +++ b/tests/security/open_basedir_file_get_contents.phpt @@ -31,42 +31,42 @@ bool(true) Warning: file_get_contents(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(../bad): Failed to open stream: %s in %s on line %d +Warning: file_get_contents(): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(../bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: file_get_contents(): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(..): Failed to open stream: %s in %s on line %d +Warning: file_get_contents(): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(../): Failed to open stream: %s in %s on line %d +Warning: file_get_contents(): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(/): Failed to open stream: %s in %s on line %d +Warning: file_get_contents(): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(../bad/.): Failed to open stream: %s in %s on line %d +Warning: file_get_contents(): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(%s/test/bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: file_get_contents(): Failed to open stream: %s in %s on line %d bool(false) Warning: file_get_contents(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_get_contents(%s/test/bad/../bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: file_get_contents(): Failed to open stream: %s in %s on line %d bool(false) string(12) "Hello World!" string(12) "Hello World!" diff --git a/tests/security/open_basedir_file_put_contents.phpt b/tests/security/open_basedir_file_put_contents.phpt index b7536d973a18..63a2020c8966 100644 --- a/tests/security/open_basedir_file_put_contents.phpt +++ b/tests/security/open_basedir_file_put_contents.phpt @@ -31,26 +31,26 @@ bool(true) Warning: file_put_contents(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_put_contents(../bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d bool(false) Warning: file_put_contents(): open_basedir restriction in effect. File(.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_put_contents(.././bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d bool(false) Warning: file_put_contents(): open_basedir restriction in effect. File(../bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_put_contents(../bad/../bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d bool(false) Warning: file_put_contents(): open_basedir restriction in effect. File(./.././bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_put_contents(./.././bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d bool(false) Warning: file_put_contents(): open_basedir restriction in effect. File%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: file_put_contents%s/test/bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: file_put_contents(): Failed to open stream: %s in %s on line %d bool(false) *** Finished testing open_basedir configuration [file_put_contents] *** diff --git a/tests/security/open_basedir_fopen.phpt b/tests/security/open_basedir_fopen.phpt index cd4a644edc50..614444595a88 100644 --- a/tests/security/open_basedir_fopen.phpt +++ b/tests/security/open_basedir_fopen.phpt @@ -40,42 +40,42 @@ bool(true) Warning: fopen(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(../bad): Failed to open stream: %s in %s on line %d +Warning: fopen(): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(../bad/bad.txt): Failed to open stream: %s in %s on line %d +Warning: fopen(): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(..): Failed to open stream: %s in %s on line %d +Warning: fopen(): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(../): Failed to open stream: %s in %s on line %d +Warning: fopen(): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(/): Failed to open stream: %s in %s on line %d +Warning: fopen(): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(../bad/.): Failed to open stream: %s in %s on line %d +Warning: fopen(): Failed to open stream: %s in %s on line %d bool(false) Warning: fopen(): open_basedir restriction in effect. File(../bad/./bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(../bad/./bad.txt): Failed to open stream: %s in %s on line 12 +Warning: fopen(): Failed to open stream: %s in %s on line 12 bool(false) Warning: fopen(): open_basedir restriction in effect. File(./../.) is not within the allowed path(s): (.) in %s on line %d -Warning: fopen(./../.): Failed to open stream: %s in %s on line %d +Warning: fopen(): Failed to open stream: %s in %s on line %d bool(false) resource(%d) of type (stream) resource(%d) of type (stream) diff --git a/tests/security/open_basedir_opendir.phpt b/tests/security/open_basedir_opendir.phpt index caf5a71beceb..030a7c59a80e 100644 --- a/tests/security/open_basedir_opendir.phpt +++ b/tests/security/open_basedir_opendir.phpt @@ -29,42 +29,42 @@ bool(true) Warning: opendir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(../bad): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(../bad/bad.txt): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(..): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(../): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(/): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(../bad/.): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(%s/test/bad/bad.txt): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) Warning: opendir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: opendir(%s/test/bad/../bad/bad.txt): Failed to open directory: %s in %s on line %d +Warning: opendir(): Failed to open directory: %s in %s on line %d bool(false) resource(%d) of type (stream) resource(%d) of type (stream) diff --git a/tests/security/open_basedir_parse_ini_file.phpt b/tests/security/open_basedir_parse_ini_file.phpt index 7c9cbd8d122a..2867d01df783 100644 --- a/tests/security/open_basedir_parse_ini_file.phpt +++ b/tests/security/open_basedir_parse_ini_file.phpt @@ -39,36 +39,36 @@ bool(true) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 6 -Warning: parse_ini_file(%stest\bad): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 6 +Warning: parse_ini_file(): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 6 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad\bad.txt) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 7 -Warning: parse_ini_file(%stest\bad\bad.txt): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 7 +Warning: parse_ini_file(): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 7 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 8 -Warning: parse_ini_file(%stest): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 8 +Warning: parse_ini_file(): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 8 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 9 -Warning: parse_ini_file(%stest): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 9 +Warning: parse_ini_file(): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 9 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 10 -Warning: parse_ini_file(%stest\bad): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 10 +Warning: parse_ini_file(): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 10 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest\bad\bad.txt) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 11 -Warning: parse_ini_file(%stest\bad\bad.txt): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 11 +Warning: parse_ini_file(): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 11 bool(false) Warning: parse_ini_file(): open_basedir restriction in effect. File(%stest) is not within the allowed path(s): (.) in %sopen_basedir_parse_ini_file.php on line 12 -Warning: parse_ini_file(%stest): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 12 +Warning: parse_ini_file(): Failed to open stream: Operation not permitted in %sopen_basedir_parse_ini_file.php on line 12 bool(false) *** Finished testing open_basedir configuration [parse_ini_file] *** diff --git a/tests/security/open_basedir_scandir.phpt b/tests/security/open_basedir_scandir.phpt index 0a629cb9e7c1..d5e685277742 100644 --- a/tests/security/open_basedir_scandir.phpt +++ b/tests/security/open_basedir_scandir.phpt @@ -29,56 +29,56 @@ bool(true) Warning: scandir(): open_basedir restriction in effect. File(../bad) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(../bad): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(../bad/bad.txt): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(..): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(../) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(../): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(/) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(/): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(../bad/.) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(../bad/.): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(%s/test/bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(%s/test/bad/bad.txt): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) Warning: scandir(): open_basedir restriction in effect. File(%s/test/bad/../bad/bad.txt) is not within the allowed path(s): (.) in %s on line %d -Warning: scandir(%s/test/bad/../bad/bad.txt): Failed to open directory: %s in %s on line %d +Warning: scandir(): Failed to open directory: %s in %s on line %d Warning: scandir(): (errno 1): %s in %s on line %d bool(false) From 32a0f3b6cfdee8ae4781121e864fd0b1837ecbe4 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 19 Jul 2026 17:15:16 +0200 Subject: [PATCH 03/15] IO copy API for stream copying (#20399) This introduces new API for fd copying and modifies php_stream_copy_to_stream_ex to use it. The implementation is separated for various platforms and the end result have couple of implications: - sendfile is used for copying file to generic fd (e.g. sockets) on all platforms except Windows that use TransmitFile - splice is used for copying between generic fds (e.g. sockets) on Linux - copy_file_range should get used on alpine linux with directly using syscall (as musl does not seem to implement it) - copy_file_range is used in the loop so it is used multiple times for files bigger than 2GB on Linux. - file mmap for copying is removed as it allowed crashing PHP when another process modified mapped file - this was used as a fallback for file copying. Sendfile should partially replace it. - File to file copying was optimized on Windows with use of ReadFile and WriteFile. This also adds various tests including Linux unit tests. Closes GH-20399 Co-authored-by: David Carlier --- .github/workflows/unit-tests.yml | 4 + NEWS | 5 + UPGRADING.INTERNALS | 4 + configure.ac | 14 + .../stream_copy_to_stream_ssl_to_file.phpt | 71 ++++ ext/openssl/xp_ssl.c | 14 +- ...am_copy_to_stream_file_to_file_append.phpt | 34 ++ ...o_stream_file_to_file_dest_read_ahead.phpt | 38 ++ ..._copy_to_stream_file_to_file_over_2gb.phpt | 44 +++ ..._copy_to_stream_file_to_socket_maxlen.phpt | 57 +++ ..._copy_to_stream_file_to_socket_medium.phpt | 48 +++ ...opy_to_stream_file_to_socket_over_eof.phpt | 53 +++ .../stream_copy_to_stream_pipe_to_file.phpt | 37 ++ .../stream_copy_to_stream_pipe_to_socket.phpt | 54 +++ .../streams/stream_copy_to_stream_socket.phpt | 30 -- .../stream_copy_to_stream_socket_empty.phpt | 23 ++ ...m_copy_to_stream_socket_to_file_large.phpt | 42 +++ ..._copy_to_stream_socket_to_file_maxlen.phpt | 48 +++ ..._copy_to_stream_socket_to_file_single.phpt | 49 +++ ...m_copy_to_stream_socket_to_file_small.phpt | 42 +++ ...tream_copy_to_stream_socket_to_socket.phpt | 69 ++++ ...tream_copy_to_stream_socket_to_stdout.phpt | 32 ++ ..._to_stream_temp_source_partially_read.phpt | 27 ++ ext/zend_test/test.c | 2 +- main/io/php_io.c | 185 +++++++++ main/io/php_io_copy_freebsd.c | 98 +++++ main/io/php_io_copy_linux.c | 354 ++++++++++++++++++ main/io/php_io_copy_macos.c | 100 +++++ main/io/php_io_copy_solaris.c | 104 +++++ main/io/php_io_copy_windows.c | 189 ++++++++++ main/io/php_io_freebsd.h | 27 ++ main/io/php_io_generic.h | 21 ++ main/io/php_io_internal.h | 41 ++ main/io/php_io_linux.h | 23 ++ main/io/php_io_macos.h | 23 ++ main/io/php_io_solaris.h | 23 ++ main/io/php_io_windows.h | 23 ++ main/php_io.h | 53 +++ main/php_streams.h | 2 + main/streams/cast.c | 12 +- main/streams/memory.c | 5 + main/streams/plain_wrapper.c | 22 +- main/streams/streams.c | 205 +++------- main/streams/xp_socket.c | 12 +- tests/unit/Makefile | 4 +- tests/unit/main/test_io_copy.c | 293 +++++++++++++++ win32/build/config.w32 | 5 +- win32/build/confutils.js | 2 +- 48 files changed, 2476 insertions(+), 191 deletions(-) create mode 100644 ext/openssl/tests/stream_copy_to_stream_ssl_to_file.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_file_to_file_append.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_file_to_file_dest_read_ahead.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_file_to_file_over_2gb.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_maxlen.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_medium.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_over_eof.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_pipe_to_file.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_pipe_to_socket.phpt delete mode 100644 ext/standard/tests/streams/stream_copy_to_stream_socket.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_socket_empty.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_large.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_maxlen.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_single.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_small.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_socket_to_socket.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_socket_to_stdout.phpt create mode 100644 ext/standard/tests/streams/stream_copy_to_stream_temp_source_partially_read.phpt create mode 100644 main/io/php_io.c create mode 100644 main/io/php_io_copy_freebsd.c create mode 100644 main/io/php_io_copy_linux.c create mode 100644 main/io/php_io_copy_macos.c create mode 100644 main/io/php_io_copy_solaris.c create mode 100644 main/io/php_io_copy_windows.c create mode 100644 main/io/php_io_freebsd.h create mode 100644 main/io/php_io_generic.h create mode 100644 main/io/php_io_internal.h create mode 100644 main/io/php_io_linux.h create mode 100644 main/io/php_io_macos.h create mode 100644 main/io/php_io_solaris.h create mode 100644 main/io/php_io_windows.h create mode 100644 main/php_io.h create mode 100644 tests/unit/main/test_io_copy.c diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 6338a1cb945d..fa79580f42ec 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -3,6 +3,8 @@ on: push: paths: - 'main/network.c' + - 'main/io/**' + - 'main/php_io.h' - 'tests/unit/**' - '.github/workflows/unit-tests.yml' branches: @@ -10,6 +12,8 @@ on: pull_request: paths: - 'main/network.c' + - 'main/io/**' + - 'main/php_io.h' - 'tests/unit/**' - '.github/workflows/unit-tests.yml' branches: diff --git a/NEWS b/NEWS index 6e9921e18dcc..af7d45ecd087 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,11 @@ PHP NEWS TCP_USER_TIMEOUT, and SO_LINGER options. (Weilin Du) . Fixed various memory related issues in ext/sockets. (David Carlier) +- Streams: + . Added a new IO copy API used by php_stream_copy_to_stream_ex() that + leverages platform primitives (sendfile, splice, copy_file_range, + TransmitFile) for faster stream copying. (Jakub Zelenka, David Carlier) + 16 Jul 2026, PHP 8.6.0alpha2 - Core: diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 7b7b7c721afb..72ee0a1b2bed 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -136,6 +136,10 @@ PHP 8.6 INTERNALS UPGRADE NOTES . Added zend_compile_ast(). . Added zend_check_type_ex(). . Added zend_create_partial_closure(). + . Added a new IO copy API in . php_io_copy() copies bytes between + file descriptors using the most efficient platform primitive available + (sendfile, splice, copy_file_range, TransmitFile), and is now used by + php_stream_copy_to_stream_ex(). The mmap-based copy fallback was removed. ======================== 2. Build system changes diff --git a/configure.ac b/configure.ac index b50339063fc4..ec64637b186b 100644 --- a/configure.ac +++ b/configure.ac @@ -369,6 +369,9 @@ AC_SEARCH_LIBS([Pgrab], [proc]) dnl Haiku does not have network api in libc. AC_SEARCH_LIBS([setsockopt], [network]) +dnl Solaris/illumos provide sendfile() in libsendfile; libc on Linux/FreeBSD. +AC_SEARCH_LIBS([sendfile], [sendfile]) + dnl Check for openpty. It may require linking against libutil or libbsd. AC_CHECK_FUNCS([openpty],, [AC_SEARCH_LIBS([openpty], [util bsd], [AC_DEFINE([HAVE_OPENPTY], [1])])]) @@ -588,10 +591,12 @@ AC_CHECK_FUNCS(m4_normalize([ putenv reallocarray scandir + sendfile setenv setitimer shutdown sigprocmask + splice statfs statvfs std_syslog @@ -1685,6 +1690,15 @@ PHP_ADD_SOURCES_X([main], [PHP_FASTCGI_OBJS], [no]) +PHP_ADD_SOURCES([main/io], m4_normalize([ + php_io.c + php_io_copy_linux.c + php_io_copy_freebsd.c + php_io_copy_solaris.c + php_io_copy_macos.c + ]), + [-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1]) + PHP_ADD_SOURCES([main/poll], m4_normalize([ poll_backend_epoll.c poll_backend_eventport.c diff --git a/ext/openssl/tests/stream_copy_to_stream_ssl_to_file.phpt b/ext/openssl/tests/stream_copy_to_stream_ssl_to_file.phpt new file mode 100644 index 000000000000..76684d2917be --- /dev/null +++ b/ext/openssl/tests/stream_copy_to_stream_ssl_to_file.phpt @@ -0,0 +1,71 @@ +--TEST-- +stream_copy_to_stream() from a TLS stream copies decrypted data (no fd fast-path) +--EXTENSIONS-- +openssl +--SKIPIF-- + +--FILE-- + [ + 'local_cert' => '%s', + ]]); + $flags = STREAM_SERVER_BIND | STREAM_SERVER_LISTEN; + $server = stream_socket_server("ssl://127.0.0.1:0", $errno, $errstr, $flags, $serverCtx); + phpt_notify_server_start($server); + + $conn = stream_socket_accept($server, 5); + fwrite($conn, str_repeat("secret-", 1000)); + fclose($conn); + fclose($server); +CODE; +$serverCode = sprintf($serverCode, $certFile); + +$peerName = 'stream_copy_ssl_peer'; +$clientCode = <<<'CODE' + $clientCtx = stream_context_create(['ssl' => [ + 'verify_peer' => true, + 'cafile' => '%s', + 'peer_name' => '%s', + ]]); + $client = stream_socket_client("ssl://{{ ADDR }}", $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $clientCtx); + + $tmp = tmpfile(); + /* If the copy offloaded the raw socket fd it would write ciphertext; the + * decrypted plaintext proves it correctly fell back to the userspace loop. */ + $copied = stream_copy_to_stream($client, $tmp); + var_dump($copied); + + fseek($tmp, 0, SEEK_SET); + $content = stream_get_contents($tmp); + var_dump(strlen($content)); + var_dump($content === str_repeat("secret-", 1000)); + + fclose($tmp); + fclose($client); +CODE; +$clientCode = sprintf($clientCode, $cacertFile, $peerName); + +include 'CertificateGenerator.inc'; +$certificateGenerator = new CertificateGenerator(); +$certificateGenerator->saveCaCert($cacertFile); +$certificateGenerator->saveNewCertAsFileWithKey($peerName, $certFile); + +include 'ServerClientTestCase.inc'; +ServerClientTestCase::getInstance()->run($clientCode, $serverCode); +?> +--CLEAN-- + +--EXPECT-- +int(7000) +int(7000) +bool(true) diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index d4158634e5bc..f2adfc49075f 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -27,7 +27,7 @@ #include "zend_exceptions.h" #include "php_openssl.h" #include "php_openssl_backend.h" -#include "php_network.h" +#include "php_io.h" #include #include #include @@ -3627,6 +3627,18 @@ static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret) *(php_socket_t *)ret = sslsock->s.socket; } return SUCCESS; + case PHP_STREAM_AS_FD_FOR_COPY: + if (sslsock->ssl_active) { + return FAILURE; + } + if (ret) { + php_io_fd *copy_fd = (php_io_fd *) ret; + copy_fd->socket = sslsock->s.socket; + copy_fd->fd_type = PHP_IO_FD_SOCKET; + copy_fd->timeout = sslsock->s.timeout; + copy_fd->is_blocked = sslsock->s.is_blocked; + } + return SUCCESS; default: return FAILURE; } diff --git a/ext/standard/tests/streams/stream_copy_to_stream_file_to_file_append.phpt b/ext/standard/tests/streams/stream_copy_to_stream_file_to_file_append.phpt new file mode 100644 index 000000000000..efcec5dafbb4 --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_file_to_file_append.phpt @@ -0,0 +1,34 @@ +--TEST-- +stream_copy_to_stream() file to file with an append-mode destination +--FILE-- + +--CLEAN-- + +--EXPECT-- +int(3000) +int(3007) +bool(true) diff --git a/ext/standard/tests/streams/stream_copy_to_stream_file_to_file_dest_read_ahead.phpt b/ext/standard/tests/streams/stream_copy_to_stream_file_to_file_dest_read_ahead.phpt new file mode 100644 index 000000000000..e772b5892483 --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_file_to_file_dest_read_ahead.phpt @@ -0,0 +1,38 @@ +--TEST-- +stream_copy_to_stream() file to file with a partially read destination +--FILE-- + +--CLEAN-- + +--EXPECT-- +int(50) +int(60) +int(3000) +bool(true) diff --git a/ext/standard/tests/streams/stream_copy_to_stream_file_to_file_over_2gb.phpt b/ext/standard/tests/streams/stream_copy_to_stream_file_to_file_over_2gb.phpt new file mode 100644 index 000000000000..b8563c3c57bd --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_file_to_file_over_2gb.phpt @@ -0,0 +1,44 @@ +--TEST-- +stream_copy_to_stream() copies files larger than 2GB in full +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) +bool(true) +--CLEAN-- + diff --git a/ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_maxlen.phpt b/ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_maxlen.phpt new file mode 100644 index 000000000000..dc9e52a721d7 --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_maxlen.phpt @@ -0,0 +1,57 @@ +--TEST-- +stream_copy_to_stream() file to socket with a maxlength shorter than the file (bounded sendfile + source offset) +--SKIPIF-- + +--FILE-- +run($clientCode, $serverCode); +?> +--EXPECT-- +int(8192) +int(8192) +bool(true) +int(8192) +bool(true) diff --git a/ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_medium.phpt b/ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_medium.phpt new file mode 100644 index 000000000000..c7bd9afeedac --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_medium.phpt @@ -0,0 +1,48 @@ +--TEST-- +stream_copy_to_stream() 16k with file as $source and socket as $dest +--SKIPIF-- + +--FILE-- +run($clientCode, $serverCode); +?> +--EXPECT-- +int(16384) +int(16384) +bool(true) diff --git a/ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_over_eof.phpt b/ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_over_eof.phpt new file mode 100644 index 000000000000..7834e9420a71 --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_file_to_socket_over_eof.phpt @@ -0,0 +1,53 @@ +--TEST-- +stream_copy_to_stream() file to socket with a maxlength larger than the file (sendfile stops at EOF) +--SKIPIF-- + +--FILE-- +run($clientCode, $serverCode); +?> +--EXPECT-- +int(4096) +int(0) +int(4096) +bool(true) diff --git a/ext/standard/tests/streams/stream_copy_to_stream_pipe_to_file.phpt b/ext/standard/tests/streams/stream_copy_to_stream_pipe_to_file.phpt new file mode 100644 index 000000000000..1ef85a7b21a9 --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_pipe_to_file.phpt @@ -0,0 +1,37 @@ +--TEST-- +stream_copy_to_stream() with a pipe as $source and file as $dest +--SKIPIF-- + +--FILE-- + ['pipe', 'w']]; +$proc = proc_open( + [PHP_BINARY, '-n', '-r', 'echo str_repeat("p", 5000);'], + $descriptors, + $pipes +); +var_dump(is_resource($proc)); + +$source = $pipes[1]; +$tmp = tmpfile(); + +$copied = stream_copy_to_stream($source, $tmp); +var_dump($copied); + +fseek($tmp, 0, SEEK_SET); +$content = stream_get_contents($tmp); +var_dump(strlen($content)); +var_dump($content === str_repeat("p", 5000)); + +fclose($tmp); +fclose($source); +proc_close($proc); +?> +--EXPECT-- +bool(true) +int(5000) +int(5000) +bool(true) diff --git a/ext/standard/tests/streams/stream_copy_to_stream_pipe_to_socket.phpt b/ext/standard/tests/streams/stream_copy_to_stream_pipe_to_socket.phpt new file mode 100644 index 000000000000..c7a9b9293e4b --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_pipe_to_socket.phpt @@ -0,0 +1,54 @@ +--TEST-- +stream_copy_to_stream() with a pipe as $source and a socket as $dest (splice from pipe) +--SKIPIF-- + +--FILE-- + ['pipe', 'w']]; + $proc = proc_open( + [PHP_BINARY, '-n', '-r', 'echo str_repeat("p", 5000);'], + $descriptors, + $pipes + ); + + $source = $pipes[1]; + $dest = stream_socket_client("tcp://{{ ADDR }}", $errno, $errstr, 10); + + $copied = stream_copy_to_stream($source, $dest); + var_dump($copied); + + fclose($dest); + fclose($source); + proc_close($proc); + + var_dump((int) trim(phpt_wait())); + var_dump(trim(phpt_wait()) === "match"); +CODE; + +include sprintf("%s/../../../openssl/tests/ServerClientTestCase.inc", __DIR__); +ServerClientTestCase::getInstance()->run($clientCode, $serverCode); +?> +--EXPECT-- +int(5000) +int(5000) +bool(true) diff --git a/ext/standard/tests/streams/stream_copy_to_stream_socket.phpt b/ext/standard/tests/streams/stream_copy_to_stream_socket.phpt deleted file mode 100644 index dafe90e40c40..000000000000 --- a/ext/standard/tests/streams/stream_copy_to_stream_socket.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---TEST-- -stream_copy_to_stream() with socket as $source ---SKIPIF-- - ---FILE-- - ---EXPECT-- -string(1) "a" -string(1) "a" diff --git a/ext/standard/tests/streams/stream_copy_to_stream_socket_empty.phpt b/ext/standard/tests/streams/stream_copy_to_stream_socket_empty.phpt new file mode 100644 index 000000000000..a0cf3e61bcaf --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_socket_empty.phpt @@ -0,0 +1,23 @@ +--TEST-- +stream_copy_to_stream() from a socket already at EOF returns 0, not false +--SKIPIF-- + +--FILE-- + +--EXPECT-- +int(0) diff --git a/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_large.phpt b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_large.phpt new file mode 100644 index 000000000000..6d66bf4f81ba --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_large.phpt @@ -0,0 +1,42 @@ +--TEST-- +stream_copy_to_stream() 200k bytes with socket as $source and file as $dest +--SKIPIF-- + +--FILE-- +run($clientCode, $serverCode); +?> +--EXPECT-- +int(200000) diff --git a/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_maxlen.phpt b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_maxlen.phpt new file mode 100644 index 000000000000..13fcc475059b --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_maxlen.phpt @@ -0,0 +1,48 @@ +--TEST-- +stream_copy_to_stream() socket to file with a maxlength shorter than the data +--SKIPIF-- + +--FILE-- +run($clientCode, $serverCode); +?> +--EXPECT-- +int(4096) +int(4096) +bool(true) diff --git a/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_single.phpt b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_single.phpt new file mode 100644 index 000000000000..a5b694ce5650 --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_single.phpt @@ -0,0 +1,49 @@ +--TEST-- +stream_copy_to_stream() single byte with socket as $source and file as $dest +--SKIPIF-- + +--FILE-- +run($clientCode, $serverCode); +?> +--EXPECT-- +string(1) "a" +string(1) "a" diff --git a/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_small.phpt b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_small.phpt new file mode 100644 index 000000000000..9b4f8befce93 --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_file_small.phpt @@ -0,0 +1,42 @@ +--TEST-- +stream_copy_to_stream() 2048 bytes with socket as $source and file as $dest +--SKIPIF-- + +--FILE-- +run($clientCode, $serverCode); +?> +--EXPECTF-- +string(2048) "aaaaa%saaa" diff --git a/ext/standard/tests/streams/stream_copy_to_stream_socket_to_socket.phpt b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_socket.phpt new file mode 100644 index 000000000000..d462d5117091 --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_socket.phpt @@ -0,0 +1,69 @@ +--TEST-- +stream_copy_to_stream() socket to socket (splice both directions) +--SKIPIF-- + +--FILE-- +run($clientCode, [ + 'source' => $sourceCode, + 'dest' => $destCode, +]); +?> +--EXPECT-- +int(10000) +int(10000) +bool(true) diff --git a/ext/standard/tests/streams/stream_copy_to_stream_socket_to_stdout.phpt b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_stdout.phpt new file mode 100644 index 000000000000..f378207f4ef3 --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_socket_to_stdout.phpt @@ -0,0 +1,32 @@ +--TEST-- +stream_copy_to_stream() with socket as $source and STDOUT as $dest +--SKIPIF-- + +--FILE-- +run($clientCode, $serverCode); +?> +--EXPECT-- +data to stdout diff --git a/ext/standard/tests/streams/stream_copy_to_stream_temp_source_partially_read.phpt b/ext/standard/tests/streams/stream_copy_to_stream_temp_source_partially_read.phpt new file mode 100644 index 000000000000..7c4f74f9f873 --- /dev/null +++ b/ext/standard/tests/streams/stream_copy_to_stream_temp_source_partially_read.phpt @@ -0,0 +1,27 @@ +--TEST-- +stream_copy_to_stream() with a partially read file-backed php://temp source +--FILE-- + +--EXPECT-- +int(2000) +int(2000) +bool(true) diff --git a/ext/zend_test/test.c b/ext/zend_test/test.c index d1875c4946de..e8058936b6da 100644 --- a/ext/zend_test/test.c +++ b/ext/zend_test/test.c @@ -1892,7 +1892,7 @@ typedef off_t off64_t; PHP_ZEND_TEST_API ssize_t copy_file_range(int fd_in, off64_t *off_in, int fd_out, off64_t *off_out, size_t len, unsigned int flags) { ssize_t (*original_copy_file_range)(int, off64_t *, int, off64_t *, size_t, unsigned int) = dlsym(RTLD_NEXT, "copy_file_range"); - if (ZT_G(limit_copy_file_range) >= Z_L(0)) { + if (ZT_G(limit_copy_file_range) >= Z_L(0) && ZT_G(limit_copy_file_range) < len) { len = ZT_G(limit_copy_file_range); } return original_copy_file_range(fd_in, off_in, fd_out, off_out, len, flags); diff --git a/main/io/php_io.c b/main/io/php_io.c new file mode 100644 index 000000000000..bd45ec888790 --- /dev/null +++ b/main/io/php_io.c @@ -0,0 +1,185 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Jakub Zelenka | + +----------------------------------------------------------------------+ +*/ + +#include "php.h" +#include "php_io.h" +#include "php_io_internal.h" + +#include + +#ifdef PHP_WIN32 +#include +#include +#else +#include +#include +#endif + +static php_io php_io_instance = { + .copy = PHP_IO_PLATFORM_COPY, + .platform_name = PHP_IO_PLATFORM_NAME, +}; + +PHPAPI php_io *php_io_get(void) +{ + return &php_io_instance; +} + +PHPAPI zend_result php_io_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied) +{ + return php_io_get()->copy(src, dest, maxlen, copied); +} + +zend_result php_io_generic_copy_fallback(int src_fd, int dest_fd, size_t maxlen, size_t *copied) +{ + char buf[PHP_IO_COPY_BUFSIZE]; + size_t total_copied = 0; + size_t remaining = (maxlen == PHP_IO_COPY_ALL) ? SIZE_MAX : maxlen; + zend_result result = SUCCESS; + + while (remaining > 0) { + size_t to_read = (remaining < sizeof(buf)) ? remaining : sizeof(buf); + ssize_t bytes_read; + do { + bytes_read = read(src_fd, buf, to_read); + } while (bytes_read < 0 && errno == EINTR); + + if (bytes_read < 0) { + result = FAILURE; + break; + } else if (bytes_read == 0) { + break; + } + + char *writeptr = buf; + size_t to_write = (size_t) bytes_read; + + while (to_write > 0) { + ssize_t bytes_written; + do { + bytes_written = write(dest_fd, writeptr, to_write); + } while (bytes_written < 0 && errno == EINTR); + if (bytes_written <= 0) { + result = FAILURE; + break; + } + total_copied += bytes_written; + writeptr += bytes_written; + to_write -= bytes_written; + } + if (result == FAILURE) { + break; + } + + if (maxlen != PHP_IO_COPY_ALL) { + remaining -= bytes_read; + } + } + + *copied = total_copied; + return result; +} + +/* For a blocking socket source, wait until data is available (or the configured + * timeout elapses) before reading. Mirrors the per-platform wait_for_data + * helpers so the generic copy path honours stream timeouts on systems without a + * kernel offload (e.g. Haiku). Returns >0 ready, 0 timeout, <0 error. */ +#ifndef PHP_WIN32 +static int php_io_generic_wait_for_data(php_io_fd *fd) +{ + if (fd->fd_type != PHP_IO_FD_SOCKET || !fd->is_blocked) { + return 1; + } + + int timeout_ms = (fd->timeout.tv_sec == -1) + ? -1 + : (int) (fd->timeout.tv_sec * 1000 + fd->timeout.tv_usec / 1000); + + struct pollfd pfd; + pfd.fd = fd->fd; + pfd.events = POLLIN; + + int ret; + do { + ret = poll(&pfd, 1, timeout_ms); + } while (ret == -1 && errno == EINTR); + + return ret; +} +#else +static int php_io_generic_wait_for_data(php_io_fd *fd) +{ + (void) fd; + return 1; +} +#endif + +zend_result php_io_generic_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied) +{ + char buf[PHP_IO_COPY_BUFSIZE]; + size_t total_copied = 0; + size_t remaining = (maxlen == PHP_IO_COPY_ALL) ? SIZE_MAX : maxlen; + zend_result result = SUCCESS; + + while (remaining > 0) { + int ready = php_io_generic_wait_for_data(src); + if (ready == 0) { + /* timeout */ + break; + } else if (ready < 0) { + result = FAILURE; + break; + } + + size_t to_read = (remaining < sizeof(buf)) ? remaining : sizeof(buf); + ssize_t bytes_read; + do { + bytes_read = read(src->fd, buf, to_read); + } while (bytes_read < 0 && errno == EINTR); + + if (bytes_read < 0) { + result = FAILURE; + break; + } else if (bytes_read == 0) { + break; + } + + char *writeptr = buf; + size_t to_write = (size_t) bytes_read; + + while (to_write > 0) { + ssize_t bytes_written; + do { + bytes_written = write(dest->fd, writeptr, to_write); + } while (bytes_written < 0 && errno == EINTR); + if (bytes_written <= 0) { + result = FAILURE; + break; + } + total_copied += bytes_written; + writeptr += bytes_written; + to_write -= bytes_written; + } + if (result == FAILURE) { + break; + } + + if (maxlen != PHP_IO_COPY_ALL) { + remaining -= bytes_read; + } + } + + *copied = total_copied; + return result; +} diff --git a/main/io/php_io_copy_freebsd.c b/main/io/php_io_copy_freebsd.c new file mode 100644 index 000000000000..41f5bc3e0681 --- /dev/null +++ b/main/io/php_io_copy_freebsd.c @@ -0,0 +1,98 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: David Carlier | + +----------------------------------------------------------------------+ +*/ + +#if defined(__FreeBSD__) || defined(__DragonFly__) + +#include "php_io_internal.h" +#include +#include +#include +#include +#include + +/* Hint the kernel to read ahead a few pages from the source file so the disk + * I/O overlaps with the network send. SF_FLAGS() is FreeBSD-specific and may be + * absent on DragonFly, in which case we pass plain 0 (no readahead hint). */ +#ifdef SF_FLAGS +# define PHP_IO_FREEBSD_SF_FLAGS SF_FLAGS(16, 0) +#else +# define PHP_IO_FREEBSD_SF_FLAGS 0 +#endif + +static zend_result php_io_freebsd_sendfile(int src_fd, int dest_fd, size_t maxlen, size_t *copied) +{ + off_t start_offset = lseek(src_fd, 0, SEEK_CUR); + if (start_offset == (off_t) -1) { + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); + } + + off_t total_sent = 0; + size_t remaining = (maxlen == PHP_IO_COPY_ALL) ? 0 : maxlen; + zend_result result = SUCCESS; + + while (maxlen == PHP_IO_COPY_ALL || remaining > 0) { + off_t sent_in_this_call = 0; + int sendfile_result = sendfile(src_fd, dest_fd, start_offset + total_sent, remaining, NULL, + &sent_in_this_call, PHP_IO_FREEBSD_SF_FLAGS); + + if (sent_in_this_call > 0) { + total_sent += sent_in_this_call; + if (maxlen != PHP_IO_COPY_ALL) { + remaining -= (size_t) sent_in_this_call; + } + } + + if (sendfile_result == 0) { + if (sent_in_this_call == 0 || remaining == 0) { + break; + } + } else { + if (errno == EINTR) { + continue; + } + if (errno == EAGAIN) { + if (sent_in_this_call > 0) { + continue; + } + break; + } + if (total_sent == 0) { + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); + } + result = FAILURE; + break; + } + } + + if (total_sent > 0) { + /* best effort: keep reporting the delivered bytes even if this fails */ + lseek(src_fd, start_offset + total_sent, SEEK_SET); + } + + *copied = (size_t) total_sent; + return result; +} + +zend_result php_io_freebsd_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied) +{ + /* unlike linux, sendfile on freebsd works only under those conditions */ + if (src->fd_type == PHP_IO_FD_FILE && dest->fd_type == PHP_IO_FD_SOCKET) { + return php_io_freebsd_sendfile(src->fd, dest->fd, maxlen, copied); + } + + /* php_io_generic_copy honours the stream timeout for socket sources */ + return php_io_generic_copy(src, dest, maxlen, copied); +} + +#endif diff --git a/main/io/php_io_copy_linux.c b/main/io/php_io_copy_linux.c new file mode 100644 index 000000000000..9a1810349d3d --- /dev/null +++ b/main/io/php_io_copy_linux.c @@ -0,0 +1,354 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Jakub Zelenka | + +----------------------------------------------------------------------+ +*/ + +#ifdef __linux__ + +#include "php_io_internal.h" +#include +#include +#include + +#if !defined(HAVE_COPY_FILE_RANGE) && defined(__NR_copy_file_range) +#define HAVE_COPY_FILE_RANGE 1 +static inline ssize_t copy_file_range( + int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned int flags) +{ + return syscall(__NR_copy_file_range, fd_in, off_in, fd_out, off_out, len, flags); +} +#endif + +#ifdef HAVE_SENDFILE +#include +#endif + +#ifdef HAVE_SPLICE +#include +#include +#include +#include +#endif + +static inline int php_io_linux_wait_for_data(php_io_fd *fd) +{ + if (fd->fd_type != PHP_IO_FD_SOCKET || !fd->is_blocked) { + return 1; + } + + struct timeval *ptimeout = (fd->timeout.tv_sec == -1) ? NULL : &fd->timeout; + int timeout_ms; + + if (ptimeout == NULL) { + timeout_ms = -1; + } else { + timeout_ms = ptimeout->tv_sec * 1000 + ptimeout->tv_usec / 1000; + } + + struct pollfd pfd; + pfd.fd = fd->fd; + pfd.events = POLLIN; + + int ret; + do { + ret = poll(&pfd, 1, timeout_ms); + } while (ret == -1 && errno == EINTR); + + return ret; +} + +static zend_result php_io_linux_copy_file_to_file(int src_fd, int dest_fd, size_t maxlen, size_t *copied) +{ +#ifdef HAVE_COPY_FILE_RANGE + size_t total_copied = 0; + size_t remaining = (maxlen == PHP_IO_COPY_ALL) ? SIZE_MAX : maxlen; + + while (remaining > 0) { + size_t to_copy = (remaining < SSIZE_MAX) ? remaining : SSIZE_MAX; + ssize_t result = copy_file_range(src_fd, NULL, dest_fd, NULL, to_copy, 0); + + if (result > 0) { + total_copied += result; + if (maxlen != PHP_IO_COPY_ALL) { + remaining -= result; + } + } else if (result == 0) { + break; + } else { + switch (errno) { + case EINVAL: + case EXDEV: + case ENOSYS: + case EIO: + if (total_copied == 0) { + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); + } + break; + default: + *copied = total_copied; + return FAILURE; + } + break; + } + } + + if (total_copied > 0) { + *copied = total_copied; + return SUCCESS; + } +#endif + + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); +} + +static zend_result php_io_linux_sendfile(int src_fd, int dest_fd, size_t maxlen, size_t *copied) +{ +#ifdef HAVE_SENDFILE + size_t total_copied = 0; + size_t remaining = (maxlen == PHP_IO_COPY_ALL) ? SIZE_MAX : maxlen; + + while (remaining > 0) { + size_t to_send = (remaining < SSIZE_MAX) ? remaining : SSIZE_MAX; + ssize_t result = sendfile(dest_fd, src_fd, NULL, to_send); + + if (result > 0) { + total_copied += result; + if (maxlen != PHP_IO_COPY_ALL) { + remaining -= result; + } + } else if (result == 0) { + break; + } else { + switch (errno) { + case EINTR: + continue; + case EINVAL: + case ENOSYS: + if (total_copied == 0) { + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); + } + break; + case EAGAIN: + break; + default: + *copied = total_copied; + return FAILURE; + } + break; + } + } + + if (total_copied > 0) { + *copied = total_copied; + return SUCCESS; + } +#endif + + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); +} + +#ifdef HAVE_SPLICE +/* Enlarge the intermediate pipe so socket transfers move more data per splice + * round-trip. Capped by /proc/sys/fs/pipe-max-size (1 MiB by default); a failed + * fcntl() simply leaves the kernel default (64 KiB) in place. */ +#define PHP_IO_PIPE_SIZE (1 << 20) + +/* Kernel MAX_RW_COUNT; a larger len fails the pos + len overflow check with + * EINVAL once a file destination sits at a non-zero offset. */ +#define PHP_IO_SPLICE_MAX ((size_t) 0x7ffff000) + +/* SPLICE_F_MORE corks the socket the same way MSG_MORE does, letting the kernel + * coalesce splices into full segments. The final partial segment is not flushed + * by the kernel until the cork timer (<= 200 ms) expires or the socket is next + * written/closed, so the copy loops below clear the cork once they are done. */ +static inline unsigned int php_io_linux_out_flags(const php_io_fd *dest) +{ + return (dest->fd_type == PHP_IO_FD_SOCKET) ? SPLICE_F_MORE : 0; +} + +/* Clearing TCP_CORK pushes out any segment still held by SPLICE_F_MORE; + * on non-TCP sockets the setsockopt() harmlessly fails. */ +static inline void php_io_linux_socket_uncork(const php_io_fd *dest, size_t total_copied) +{ + if (dest->fd_type == PHP_IO_FD_SOCKET && total_copied > 0) { + int off = 0; + setsockopt(dest->fd, IPPROTO_TCP, TCP_CORK, &off, sizeof(off)); + } +} + +static zend_result php_io_linux_splice_from_pipe(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied) +{ + int dest_fd = dest->fd; + unsigned int out_flags = php_io_linux_out_flags(dest); + size_t total_copied = 0; + size_t remaining = (maxlen == PHP_IO_COPY_ALL) ? SIZE_MAX : maxlen; + zend_result result = SUCCESS; + + while (remaining > 0) { + int ready = php_io_linux_wait_for_data(src); + if (ready == 0) { + break; + } else if (ready < 0) { + result = FAILURE; + break; + } + + size_t to_copy = (remaining < PHP_IO_SPLICE_MAX) ? remaining : PHP_IO_SPLICE_MAX; + ssize_t spliced = splice(src->fd, NULL, dest_fd, NULL, to_copy, out_flags); + + if (spliced > 0) { + total_copied += spliced; + if (maxlen != PHP_IO_COPY_ALL) { + remaining -= spliced; + } + } else if (spliced == 0) { + break; + } else { + if (total_copied == 0) { + return php_io_generic_copy_fallback(src->fd, dest_fd, maxlen, copied); + } + result = FAILURE; + break; + } + } + + php_io_linux_socket_uncork(dest, total_copied); + *copied = total_copied; + return result; +} + +static zend_result php_io_linux_splice_via_pipe(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied) +{ + int dest_fd = dest->fd; + unsigned int out_flags = php_io_linux_out_flags(dest); + int pipefd[2]; + if (pipe(pipefd) == -1) { + return php_io_generic_copy_fallback(src->fd, dest_fd, maxlen, copied); + } + +#ifdef F_SETPIPE_SZ + fcntl(pipefd[1], F_SETPIPE_SZ, PHP_IO_PIPE_SIZE); +#endif + + size_t total_copied = 0; + size_t remaining = (maxlen == PHP_IO_COPY_ALL) ? SIZE_MAX : maxlen; + zend_result result = SUCCESS; + + while (remaining > 0) { + int ready = php_io_linux_wait_for_data(src); + if (ready == 0) { + /* timeout */ + break; + } else if (ready < 0) { + result = FAILURE; + break; + } + + size_t to_copy = (remaining < SSIZE_MAX) ? remaining : SSIZE_MAX; + + ssize_t in_pipe = splice(src->fd, NULL, pipefd[1], NULL, to_copy, 0); + if (in_pipe < 0) { + if (total_copied == 0) { + close(pipefd[0]); + close(pipefd[1]); + return php_io_generic_copy_fallback(src->fd, dest_fd, maxlen, copied); + } + result = FAILURE; + break; + } + if (in_pipe == 0) { + break; + } + + size_t pipe_remaining = in_pipe; + while (pipe_remaining > 0) { + ssize_t out = splice(pipefd[0], NULL, dest_fd, NULL, pipe_remaining, out_flags); + if (out <= 0) { + /* the dest refused the splice; salvage what already sits in + * the pipe with a plain read/write loop before failing */ + char drain_buf[1024]; + while (pipe_remaining > 0) { + size_t to_drain = (pipe_remaining < sizeof(drain_buf)) + ? pipe_remaining : sizeof(drain_buf); + ssize_t drained; + do { + drained = read(pipefd[0], drain_buf, to_drain); + } while (drained < 0 && errno == EINTR); + if (drained <= 0) { + break; + } + ssize_t drain_written = 0; + while (drain_written < drained) { + ssize_t written; + do { + written = write(dest_fd, drain_buf + drain_written, drained - drain_written); + } while (written < 0 && errno == EINTR); + if (written <= 0) { + total_copied += drain_written; + result = FAILURE; + goto out; + } + drain_written += written; + } + pipe_remaining -= drain_written; + total_copied += drain_written; + } + result = FAILURE; + goto out; + } + pipe_remaining -= out; + total_copied += out; + } + + if (maxlen != PHP_IO_COPY_ALL) { + remaining -= in_pipe; + } + } + +out: + close(pipefd[0]); + close(pipefd[1]); + php_io_linux_socket_uncork(dest, total_copied); + *copied = total_copied; + return result; +} +#endif /* HAVE_SPLICE */ + +zend_result php_io_linux_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied) +{ + if (src->fd_type == PHP_IO_FD_FILE && dest->fd_type == PHP_IO_FD_FILE) { + return php_io_linux_copy_file_to_file(src->fd, dest->fd, maxlen, copied); + } + + if (src->fd_type == PHP_IO_FD_FILE && dest->fd_type == PHP_IO_FD_SOCKET) { + return php_io_linux_sendfile(src->fd, dest->fd, maxlen, copied); + } + + if (src->fd_type == PHP_IO_FD_FILE && dest->fd_type == PHP_IO_FD_PIPE) { + return php_io_linux_sendfile(src->fd, dest->fd, maxlen, copied); + } + +#ifdef HAVE_SPLICE + if (src->fd_type == PHP_IO_FD_PIPE) { + return php_io_linux_splice_from_pipe(src, dest, maxlen, copied); + } + + if (src->fd_type == PHP_IO_FD_SOCKET) { + return php_io_linux_splice_via_pipe(src, dest, maxlen, copied); + } +#endif + + /* php_io_generic_copy honours the stream timeout for socket sources */ + return php_io_generic_copy(src, dest, maxlen, copied); +} + +#endif /* __linux__ */ diff --git a/main/io/php_io_copy_macos.c b/main/io/php_io_copy_macos.c new file mode 100644 index 000000000000..0ad73c87a39a --- /dev/null +++ b/main/io/php_io_copy_macos.c @@ -0,0 +1,100 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: David Carlier | + +----------------------------------------------------------------------+ +*/ + +#if defined(__APPLE__) + +#include "php_io_internal.h" +#include +#include +#include +#include +#include + +static zend_result php_io_macos_sendfile(int src_fd, int dest_fd, size_t maxlen, size_t *copied) +{ +#ifdef HAVE_SENDFILE + /* macOS sendfile() takes an explicit offset and does not advance the + * source descriptor, so remember the starting position and restore it + * afterwards to keep the streams-layer contract. */ + off_t start_offset = lseek(src_fd, 0, SEEK_CUR); + if (start_offset == (off_t) -1) { + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); + } + + off_t total_sent = 0; + size_t remaining = (maxlen == PHP_IO_COPY_ALL) ? 0 : maxlen; + zend_result result = SUCCESS; + + while (maxlen == PHP_IO_COPY_ALL || remaining > 0) { + /* len is in/out: on input the number of bytes to send (0 means + * until end of file), on output the number of bytes actually sent + * (populated even when sendfile() reports EINTR/EAGAIN). */ + off_t len = (maxlen == PHP_IO_COPY_ALL) ? 0 : (off_t) remaining; + int sendfile_result = sendfile(src_fd, dest_fd, start_offset + total_sent, &len, NULL, 0); + + if (len > 0) { + total_sent += len; + if (maxlen != PHP_IO_COPY_ALL) { + remaining -= (size_t) len; + } + } + + if (sendfile_result == 0) { + /* Reached EOF or sent the whole requested range. */ + if (len == 0 || maxlen == PHP_IO_COPY_ALL || remaining == 0) { + break; + } + } else { + if (errno == EINTR) { + continue; + } + if (errno == EAGAIN) { + if (len > 0) { + continue; + } + break; + } + if (total_sent == 0) { + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); + } + result = FAILURE; + break; + } + } + + if (total_sent > 0) { + /* best effort: keep reporting the delivered bytes even if this fails */ + lseek(src_fd, start_offset + total_sent, SEEK_SET); + } + + *copied = (size_t) total_sent; + return result; +#else + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); +#endif +} + +zend_result php_io_macos_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied) +{ + /* Like FreeBSD, macOS sendfile() works only with a regular file source + * and a socket destination. */ + if (src->fd_type == PHP_IO_FD_FILE && dest->fd_type == PHP_IO_FD_SOCKET) { + return php_io_macos_sendfile(src->fd, dest->fd, maxlen, copied); + } + + /* php_io_generic_copy honours the stream timeout for socket sources */ + return php_io_generic_copy(src, dest, maxlen, copied); +} + +#endif diff --git a/main/io/php_io_copy_solaris.c b/main/io/php_io_copy_solaris.c new file mode 100644 index 000000000000..6812bbe3081d --- /dev/null +++ b/main/io/php_io_copy_solaris.c @@ -0,0 +1,104 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: David Carlier | + +----------------------------------------------------------------------+ + */ + +#if defined(__sun) && defined(__SVR4) + +#include "php_io_internal.h" +#include +#include +#include +#include +#include + +static zend_result php_io_solaris_sendfile(int src_fd, int dest_fd, size_t maxlen, size_t *copied) +{ +#ifdef HAVE_SENDFILE + /* Solaris/illumos sendfile() takes an explicit offset and does not + * advance the source descriptor, so remember the starting position and + * restore it afterwards to keep the streams-layer contract. */ + off_t start_offset = lseek(src_fd, 0, SEEK_CUR); + if (start_offset == (off_t) -1) { + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); + } + + /* Unlike Linux, Solaris sendfile() returns -1/EINVAL (rather than 0) when + * called with an offset at or past EOF, so a trailing call issued after the + * source has been fully consumed would spuriously fail an otherwise complete + * copy. Bound the loop to the bytes actually available in the source file so + * we stop exactly at EOF and never call sendfile() past it. */ + struct stat st; + if (fstat(src_fd, &st) != 0 || !S_ISREG(st.st_mode)) { + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); + } + + size_t available = (st.st_size > start_offset) ? (size_t) (st.st_size - start_offset) : 0; + size_t target = (maxlen == PHP_IO_COPY_ALL || maxlen > available) ? available : maxlen; + + off_t offset = start_offset; + size_t total_copied = 0; + zend_result result = SUCCESS; + + while (total_copied < target) { + size_t remaining = target - total_copied; + size_t to_send = (remaining < SSIZE_MAX) ? remaining : SSIZE_MAX; + /* offset is updated in place by sendfile() */ + ssize_t sent = sendfile(dest_fd, src_fd, &offset, to_send); + + if (sent > 0) { + total_copied += (size_t) sent; + } else if (sent == 0) { + /* Source shrank under us; stop with what we have. */ + break; + } else { + if (errno == EINTR) { + continue; + } + if (errno == EAGAIN) { + break; + } + if (total_copied == 0) { + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); + } + result = FAILURE; + break; + } + } + + if (total_copied > 0) { + /* best effort: keep reporting the delivered bytes even if this fails */ + lseek(src_fd, start_offset + (off_t) total_copied, SEEK_SET); + } + + *copied = total_copied; + return result; +#else + return php_io_generic_copy_fallback(src_fd, dest_fd, maxlen, copied); +#endif +} + +zend_result php_io_solaris_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied) +{ + /* Unlike FreeBSD, Solaris/illumos sendfile() accepts both a socket and a + * regular file as the output descriptor, so file->socket and file->file + * can both be offloaded. */ + if (src->fd_type == PHP_IO_FD_FILE && + (dest->fd_type == PHP_IO_FD_SOCKET || dest->fd_type == PHP_IO_FD_FILE)) { + return php_io_solaris_sendfile(src->fd, dest->fd, maxlen, copied); + } + + /* php_io_generic_copy honours the stream timeout for socket sources */ + return php_io_generic_copy(src, dest, maxlen, copied); +} + +#endif diff --git a/main/io/php_io_copy_windows.c b/main/io/php_io_copy_windows.c new file mode 100644 index 000000000000..de75d2529987 --- /dev/null +++ b/main/io/php_io_copy_windows.c @@ -0,0 +1,189 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Jakub Zelenka | + +----------------------------------------------------------------------+ +*/ + +#include "php_io_internal.h" + +#ifdef PHP_WIN32 + +#include +#include +#include + +static inline ssize_t php_io_win_read(php_io_fd *fd, char *buf, int len) +{ + if (fd->fd_type == PHP_IO_FD_SOCKET) { + int result = recv(fd->socket, buf, len, 0); + return (result == SOCKET_ERROR) ? -1 : (ssize_t) result; + } + return (ssize_t) _read(fd->fd, buf, len); +} + +static inline ssize_t php_io_win_write(php_io_fd *fd, const char *buf, int len) +{ + if (fd->fd_type == PHP_IO_FD_SOCKET) { + int result = send(fd->socket, buf, len, 0); + return (result == SOCKET_ERROR) ? -1 : (ssize_t) result; + } + return (ssize_t) _write(fd->fd, buf, len); +} + +static inline int php_io_win_wait_for_data(php_io_fd *fd) +{ + if (fd->fd_type != PHP_IO_FD_SOCKET || !fd->is_blocked) { + return 1; + } + + int timeout_ms; + if (fd->timeout.tv_sec == -1) { + timeout_ms = -1; + } else { + timeout_ms = fd->timeout.tv_sec * 1000 + fd->timeout.tv_usec / 1000; + } + + WSAPOLLFD pfd; + pfd.fd = fd->socket; + pfd.events = POLLIN; + + int ret; + do { + ret = WSAPoll(&pfd, 1, timeout_ms); + } while (ret == SOCKET_ERROR && WSAGetLastError() == WSAEINTR); + + return (ret == SOCKET_ERROR) ? -1 : ret; +} + +static zend_result php_io_win_copy_loop(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied) +{ + char buf[PHP_IO_COPY_BUFSIZE]; + size_t total_copied = 0; + size_t remaining = (maxlen == PHP_IO_COPY_ALL) ? SIZE_MAX : maxlen; + zend_result result = SUCCESS; + + while (remaining > 0) { + int ready = php_io_win_wait_for_data(src); + if (ready == 0) { + break; + } else if (ready < 0) { + result = FAILURE; + break; + } + + int to_read = (remaining < sizeof(buf)) ? (int) remaining : (int) sizeof(buf); + ssize_t bytes_read = php_io_win_read(src, buf, to_read); + + if (bytes_read < 0) { + result = FAILURE; + break; + } else if (bytes_read == 0) { + break; + } + + const char *writeptr = buf; + size_t to_write = (size_t) bytes_read; + + while (to_write > 0) { + ssize_t bytes_written = php_io_win_write(dest, writeptr, (int) to_write); + if (bytes_written <= 0) { + result = FAILURE; + break; + } + total_copied += bytes_written; + writeptr += bytes_written; + to_write -= bytes_written; + } + if (result == FAILURE) { + break; + } + + if (maxlen != PHP_IO_COPY_ALL) { + remaining -= bytes_read; + } + } + + *copied = total_copied; + return result; +} + +/* Documented TransmitFile per-call max; larger requests get WSAEINVAL, so they + * fall back to the read/write loop. */ +#define PHP_IO_WIN_TRANSMIT_MAX ((size_t) 2147483646) + +/* Negative results from php_io_win_transmit_file(). */ +#define PHP_IO_WIN_TRANSMIT_FALLBACK ((ssize_t) -1) /* nothing sent; retry via loop */ +#define PHP_IO_WIN_TRANSMIT_ERROR ((ssize_t) -2) /* may have sent data; do not retry */ + +static ssize_t php_io_win_transmit_file(int src_fd, SOCKET dest_sock, size_t maxlen) +{ + HANDLE file_handle = (HANDLE) _get_osfhandle(src_fd); + + if (file_handle == INVALID_HANDLE_VALUE || + dest_sock == INVALID_SOCKET || + GetFileType(file_handle) != FILE_TYPE_DISK) { + return PHP_IO_WIN_TRANSMIT_FALLBACK; + } + + LARGE_INTEGER file_pos, file_size; + file_pos.QuadPart = 0; + if (!SetFilePointerEx(file_handle, file_pos, &file_pos, FILE_CURRENT)) { + return PHP_IO_WIN_TRANSMIT_FALLBACK; + } + + if (!GetFileSizeEx(file_handle, &file_size)) { + return PHP_IO_WIN_TRANSMIT_FALLBACK; + } + + LONGLONG available = file_size.QuadPart - file_pos.QuadPart; + if (available <= 0) { + return 0; + } + + /* 64-bit compare avoids truncating maxlen into the DWORD arg below */ + ULONGLONG to_send = (maxlen == PHP_IO_COPY_ALL || (ULONGLONG) maxlen > (ULONGLONG) available) + ? (ULONGLONG) available : (ULONGLONG) maxlen; + + if (to_send > PHP_IO_WIN_TRANSMIT_MAX) { + return PHP_IO_WIN_TRANSMIT_FALLBACK; + } + + if (!TransmitFile(dest_sock, file_handle, (DWORD) to_send, 0, NULL, NULL, 0)) { + /* may have sent data, so don't resend via the loop */ + return PHP_IO_WIN_TRANSMIT_ERROR; + } + + LARGE_INTEGER advance; + advance.QuadPart = (LONGLONG) to_send; + SetFilePointerEx(file_handle, advance, NULL, FILE_CURRENT); + + return (ssize_t) to_send; +} + +zend_result php_io_windows_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied) +{ + if (src->fd_type != PHP_IO_FD_SOCKET && dest->fd_type == PHP_IO_FD_SOCKET) { + ssize_t result = php_io_win_transmit_file(src->fd, dest->socket, maxlen); + if (result >= 0) { + *copied = (size_t) result; + return SUCCESS; + } + if (result == PHP_IO_WIN_TRANSMIT_ERROR) { + *copied = 0; + return FAILURE; + } + /* PHP_IO_WIN_TRANSMIT_FALLBACK: nothing was sent, copy via the loop. */ + } + + return php_io_win_copy_loop(src, dest, maxlen, copied); +} + +#endif /* PHP_WIN32 */ diff --git a/main/io/php_io_freebsd.h b/main/io/php_io_freebsd.h new file mode 100644 index 000000000000..b45bdc81831b --- /dev/null +++ b/main/io/php_io_freebsd.h @@ -0,0 +1,27 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: David Carlier | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_IO_FREEBSD_H +#define PHP_IO_FREEBSD_H + +#define PHP_IO_PLATFORM_COPY php_io_freebsd_copy +#if defined(__DragonFly__) +# define PHP_IO_PLATFORM_NAME "dragonfly" +#else +# define PHP_IO_PLATFORM_NAME "freebsd" +#endif + +zend_result php_io_freebsd_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied); + +#endif /* PHP_IO_FREEBSD_H */ diff --git a/main/io/php_io_generic.h b/main/io/php_io_generic.h new file mode 100644 index 000000000000..35a908555dda --- /dev/null +++ b/main/io/php_io_generic.h @@ -0,0 +1,21 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Jakub Zelenka | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_IO_GENERIC_H +#define PHP_IO_GENERIC_H + +#define PHP_IO_PLATFORM_COPY php_io_generic_copy +#define PHP_IO_PLATFORM_NAME "generic" + +#endif /* PHP_IO_GENERIC_H */ diff --git a/main/io/php_io_internal.h b/main/io/php_io_internal.h new file mode 100644 index 000000000000..f6bc8bf3152a --- /dev/null +++ b/main/io/php_io_internal.h @@ -0,0 +1,41 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Jakub Zelenka | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_IO_INTERNAL_H +#define PHP_IO_INTERNAL_H + +#include "php_io.h" + +/* Buffer size for the userspace read/write copy loops. Larger than the stream + * layer CHUNK_SIZE (8 KiB) to cut the number of syscalls on bulk transfers. */ +#define PHP_IO_COPY_BUFSIZE (64 * 1024) + +zend_result php_io_generic_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied); +zend_result php_io_generic_copy_fallback(int src_fd, int dest_fd, size_t maxlen, size_t *copied); + +#ifdef __linux__ +#include "php_io_linux.h" +#elif defined(PHP_WIN32) +#include "php_io_windows.h" +#elif defined(__FreeBSD__) || defined(__DragonFly__) +#include "php_io_freebsd.h" +#elif defined(__sun) && defined(__SVR4) +#include "php_io_solaris.h" +#elif defined(__APPLE__) +#include "php_io_macos.h" +#else +#include "php_io_generic.h" +#endif + +#endif /* PHP_IO_INTERNAL_H */ diff --git a/main/io/php_io_linux.h b/main/io/php_io_linux.h new file mode 100644 index 000000000000..801b31c236a5 --- /dev/null +++ b/main/io/php_io_linux.h @@ -0,0 +1,23 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Jakub Zelenka | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_IO_LINUX_H +#define PHP_IO_LINUX_H + +zend_result php_io_linux_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied); + +#define PHP_IO_PLATFORM_COPY php_io_linux_copy +#define PHP_IO_PLATFORM_NAME "linux" + +#endif /* PHP_IO_LINUX_H */ diff --git a/main/io/php_io_macos.h b/main/io/php_io_macos.h new file mode 100644 index 000000000000..b04f270e6d58 --- /dev/null +++ b/main/io/php_io_macos.h @@ -0,0 +1,23 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: David Carlier | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_IO_MACOS_H +#define PHP_IO_MACOS_H + +#define PHP_IO_PLATFORM_COPY php_io_macos_copy +#define PHP_IO_PLATFORM_NAME "macos" + +zend_result php_io_macos_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied); + +#endif /* PHP_IO_MACOS_H */ diff --git a/main/io/php_io_solaris.h b/main/io/php_io_solaris.h new file mode 100644 index 000000000000..ccba6e6ddd82 --- /dev/null +++ b/main/io/php_io_solaris.h @@ -0,0 +1,23 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: David Carlier | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_IO_SOLARIS_H +#define PHP_IO_SOLARIS_H + +#define PHP_IO_PLATFORM_COPY php_io_solaris_copy +#define PHP_IO_PLATFORM_NAME "solaris" + +zend_result php_io_solaris_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied); + +#endif /* PHP_IO_SOLARIS_H */ diff --git a/main/io/php_io_windows.h b/main/io/php_io_windows.h new file mode 100644 index 000000000000..f6bd64f11ce6 --- /dev/null +++ b/main/io/php_io_windows.h @@ -0,0 +1,23 @@ +/* + +----------------------------------------------------------------------+ + | Copyright © The PHP Group and Contributors. | + +----------------------------------------------------------------------+ + | This source file is subject to the Modified BSD License that is | + | bundled with this package in the file LICENSE, and is available | + | through the World Wide Web at . | + | | + | SPDX-License-Identifier: BSD-3-Clause | + +----------------------------------------------------------------------+ + | Authors: Jakub Zelenka | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_IO_WINDOWS_H +#define PHP_IO_WINDOWS_H + +zend_result php_io_windows_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied); + +#define PHP_IO_PLATFORM_COPY php_io_windows_copy +#define PHP_IO_PLATFORM_NAME "windows" + +#endif /* PHP_IO_WINDOWS_H */ diff --git a/main/php_io.h b/main/php_io.h new file mode 100644 index 000000000000..79bc245ef754 --- /dev/null +++ b/main/php_io.h @@ -0,0 +1,53 @@ +/* + +----------------------------------------------------------------------+ + | Copyright (c) The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | https://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Authors: Jakub Zelenka | + +----------------------------------------------------------------------+ +*/ + +#ifndef PHP_IO_H +#define PHP_IO_H + +#include "php.h" +#include "php_network.h" + +#define PHP_IO_COPY_ALL SIZE_MAX + +typedef enum php_io_fd_type { + PHP_IO_FD_FILE = 1, + PHP_IO_FD_SOCKET, + PHP_IO_FD_PIPE, +} php_io_fd_type; + +typedef struct php_io_fd { + union { + int fd; + php_socket_t socket; + }; + php_io_fd_type fd_type; + struct timeval timeout; + unsigned is_blocked:1; +} php_io_fd; + +typedef zend_result (*php_io_copy_fn)(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied); + +typedef struct php_io { + php_io_copy_fn copy; + const char *platform_name; +} php_io; + +PHPAPI php_io *php_io_get(void); + +/* Copies up to maxlen bytes from src to dest; *copied is set even on FAILURE */ +PHPAPI zend_result php_io_copy(php_io_fd *src, php_io_fd *dest, size_t maxlen, size_t *copied); + +#endif /* PHP_IO_H */ diff --git a/main/php_streams.h b/main/php_streams.h index 7622a7295af3..be8009dba91e 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -555,6 +555,8 @@ END_EXTERN_C() #define PHP_STREAM_AS_SOCKETD 2 /* cast as fd/socket for select purposes */ #define PHP_STREAM_AS_FD_FOR_SELECT 3 +/* cast as fd/socket for copy purposes */ +#define PHP_STREAM_AS_FD_FOR_COPY 4 /* try really, really hard to make sure the cast happens (avoid using this flag if possible) */ #define PHP_STREAM_CAST_TRY_HARD 0x80000000 diff --git a/main/streams/cast.c b/main/streams/cast.c index f480f3cd59a6..863afe4ed4b9 100644 --- a/main/streams/cast.c +++ b/main/streams/cast.c @@ -194,7 +194,7 @@ PHPAPI zend_result _php_stream_cast(php_stream *stream, int castas, void **ret, castas &= ~PHP_STREAM_CAST_MASK; /* synchronize our buffer (if possible) */ - if (ret && castas != PHP_STREAM_AS_FD_FOR_SELECT) { + if (ret && castas != PHP_STREAM_AS_FD_FOR_SELECT && castas != PHP_STREAM_AS_FD_FOR_COPY) { php_stream_flush(stream); if (stream->ops->seek && (stream->flags & PHP_STREAM_FLAG_NO_SEEK) == 0) { zend_off_t dummy; @@ -204,6 +204,16 @@ PHPAPI zend_result _php_stream_cast(php_stream *stream, int castas, void **ret, } } + if (castas == PHP_STREAM_AS_FD_FOR_COPY) { + if (php_stream_is_filtered(stream)) { + return FAILURE; + } + if (stream->ops->cast && stream->ops->cast(stream, castas, ret) == SUCCESS) { + return SUCCESS; + } + return FAILURE; + } + /* filtered streams can only be cast as stdio, and only when fopencookie is present */ if (castas == PHP_STREAM_AS_STDIO) { diff --git a/main/streams/memory.c b/main/streams/memory.c index 1cc1886e609d..e76598ed0f46 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -471,6 +471,11 @@ static int php_stream_temp_cast(php_stream *stream, int castas, void **ret) if (!ts->innerstream) { return FAILURE; } + if (castas == PHP_STREAM_AS_FD_FOR_COPY) { + /* the fd would come from the inner stream whose buffer state and + * position the copy fast path cannot see, so use the stream fallback */ + return FAILURE; + } if (php_stream_is(ts->innerstream, PHP_STREAM_IS_STDIO)) { return php_stream_cast(ts->innerstream, castas, ret, 0); } diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index e0fda0db78a5..4db810b8b5e2 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -32,6 +32,7 @@ #endif #include "SAPI.h" +#include "php_io.h" #include "php_streams_int.h" #ifdef PHP_WIN32 # include "win32/winutil.h" @@ -699,7 +700,6 @@ static int php_stdiop_cast(php_stream *stream, int castas, void **ret) case PHP_STREAM_AS_FD: PHP_STDIOP_GET_FD(fd, data); - if (SOCK_ERR == fd) { return FAILURE; } @@ -710,6 +710,26 @@ static int php_stdiop_cast(php_stream *stream, int castas, void **ret) *(php_socket_t *)ret = fd; } return SUCCESS; + + case PHP_STREAM_AS_FD_FOR_COPY: + /* stdio may read ahead, so use the buffered fallback for FILE* streams */ + if (data->file) { + return FAILURE; + } + PHP_STDIOP_GET_FD(fd, data); + if (SOCK_ERR == fd) { + return FAILURE; + } + if (ret) { + php_io_fd *copy_fd = (php_io_fd *) ret; + copy_fd->fd = fd; + copy_fd->fd_type = data->is_pipe ? PHP_IO_FD_PIPE : PHP_IO_FD_FILE; + copy_fd->timeout.tv_sec = 0; + copy_fd->timeout.tv_usec = 0; + copy_fd->is_blocked = 0; + } + return SUCCESS; + default: return FAILURE; } diff --git a/main/streams/streams.c b/main/streams/streams.c index 453c61b56a29..5c1041ea3a92 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -22,6 +22,7 @@ #include "php_globals.h" #include "php_memory_streams.h" #include "php_network.h" +#include "php_io.h" #include "php_open_temporary_file.h" #include "ext/standard/file.h" #include "ext/standard/basic_functions.h" /* for BG(CurrentStatFile) */ @@ -1588,164 +1589,17 @@ PHPAPI zend_string *_php_stream_copy_to_mem(php_stream *src, size_t maxlen, bool return result; } -/* Returns SUCCESS/FAILURE and sets *len to the number of bytes moved */ -PHPAPI zend_result _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size_t maxlen, size_t *len STREAMS_DC) +/* Fallback copy using stream read/write API */ +static zend_result php_stream_copy_fallback(php_stream *src, php_stream *dest, size_t maxlen, size_t *len) { char buf[CHUNK_SIZE]; size_t haveread = 0; - size_t towrite; - size_t dummy; - - if (!len) { - len = &dummy; - } - - if (maxlen == 0) { - *len = 0; - return SUCCESS; - } - -#ifdef HAVE_COPY_FILE_RANGE - if (php_stream_is(src, PHP_STREAM_IS_STDIO) && - php_stream_is(dest, PHP_STREAM_IS_STDIO) && - src->writepos == src->readpos) { - /* both php_stream instances are backed by a file descriptor, are not filtered and the - * read buffer is empty: we can use copy_file_range() */ - int src_fd, dest_fd, dest_open_flags = 0; - - /* copy_file_range does not work with O_APPEND */ - if (php_stream_cast(src, PHP_STREAM_AS_FD, (void*)&src_fd, 0) == SUCCESS && - php_stream_cast(dest, PHP_STREAM_AS_FD, (void*)&dest_fd, 0) == SUCCESS && - /* get dest open flags to check if the stream is open in append mode */ - php_stream_parse_fopen_modes(dest->mode, &dest_open_flags) == SUCCESS && - !(dest_open_flags & O_APPEND)) { - - /* clamp to INT_MAX to avoid EOVERFLOW */ - const size_t cfr_max = MIN(maxlen, (size_t)SSIZE_MAX); - - /* copy_file_range() is a Linux-specific system call which allows efficient copying - * between two file descriptors, eliminating the need to transfer data from the kernel - * to userspace and back. For networking file systems like NFS and Ceph, it even - * eliminates copying data to the client, and local filesystems like Btrfs and XFS can - * create shared extents. */ - ssize_t result = copy_file_range(src_fd, NULL, dest_fd, NULL, cfr_max, 0); - if (result > 0) { - size_t nbytes = (size_t)result; - haveread += nbytes; - - src->position += nbytes; - dest->position += nbytes; - - if ((maxlen != PHP_STREAM_COPY_ALL && nbytes == maxlen) || php_stream_eof(src)) { - /* the whole request was satisfied or end-of-file reached - done */ - *len = haveread; - return SUCCESS; - } - - /* there may be more data; continue copying using the fallback code below */ - } else if (result == 0) { - /* end of file */ - *len = haveread; - return SUCCESS; - } else if (result < 0) { - switch (errno) { - case EINVAL: - /* some formal error, e.g. overlapping file ranges */ - break; - - case EXDEV: - /* pre Linux 5.3 error */ - break; - - case ENOSYS: - /* not implemented by this Linux kernel */ - break; - - case EIO: - /* Some filesystems will cause failures if the max length is greater than the file length - * in certain circumstances and configuration. In those cases the errno is EIO and we will - * fall back to other methods. We cannot use stat to determine the file length upfront because - * that is prone to races and outdated caching. */ - break; - - default: - /* unexpected I/O error - give up, no fallback */ - *len = haveread; - return FAILURE; - } - - /* fall back to classic copying */ - } - } - } -#endif // HAVE_COPY_FILE_RANGE if (maxlen == PHP_STREAM_COPY_ALL) { maxlen = 0; } - if (php_stream_mmap_possible(src)) { - char *p; - - do { - /* We must not modify maxlen here, because otherwise the file copy fallback below can fail */ - size_t chunk_size, must_read, mapped; - if (maxlen == 0) { - /* Unlimited read */ - must_read = chunk_size = PHP_STREAM_MMAP_MAX; - } else { - must_read = maxlen - haveread; - if (must_read >= PHP_STREAM_MMAP_MAX) { - chunk_size = PHP_STREAM_MMAP_MAX; - } else { - /* In case the length we still have to read from the file could be smaller than the file size, - * chunk_size must not get bigger the size we're trying to read. */ - chunk_size = must_read; - } - } - - p = php_stream_mmap_range(src, php_stream_tell(src), chunk_size, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped); - - if (p) { - ssize_t didwrite; - - if (php_stream_seek(src, mapped, SEEK_CUR) != 0) { - php_stream_mmap_unmap(src); - break; - } - - didwrite = php_stream_write(dest, p, mapped); - if (didwrite < 0) { - *len = haveread; - php_stream_mmap_unmap(src); - return FAILURE; - } - - php_stream_mmap_unmap(src); - - *len = haveread += didwrite; - - /* we've got at least 1 byte to read - * less than 1 is an error - * AND read bytes match written */ - if (mapped == 0 || mapped != didwrite) { - return FAILURE; - } - if (mapped < chunk_size) { - return SUCCESS; - } - /* If we're not reading as much as possible, so a bounded read */ - if (maxlen != 0) { - must_read -= mapped; - if (must_read == 0) { - return SUCCESS; - } - } - } - } while (p); - } - - while(1) { + while (1) { size_t readchunk = sizeof(buf); ssize_t didread; char *writeptr; @@ -1760,14 +1614,14 @@ PHPAPI zend_result _php_stream_copy_to_stream_ex(php_stream *src, php_stream *de return didread < 0 ? FAILURE : SUCCESS; } - towrite = didread; + size_t towrite = didread; writeptr = buf; haveread += didread; while (towrite) { ssize_t didwrite = php_stream_write(dest, writeptr, towrite); if (didwrite <= 0) { - *len = haveread - (didread - towrite); + *len = haveread - towrite; return FAILURE; } @@ -1784,6 +1638,53 @@ PHPAPI zend_result _php_stream_copy_to_stream_ex(php_stream *src, php_stream *de return SUCCESS; } +PHPAPI zend_result _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size_t maxlen, size_t *len STREAMS_DC) +{ + size_t dummy; + + if (!len) { + len = &dummy; + } + + if (maxlen == 0) { + *len = 0; + return SUCCESS; + } + + /* Try optimized fd-level copy if both streams support it and their read buffers + * are empty, so the fd offsets match the logical stream positions */ + if (!php_stream_is(src, PHP_STREAM_IS_USERSPACE) && !php_stream_is(dest, PHP_STREAM_IS_USERSPACE) && + src->writepos == src->readpos && dest->writepos == dest->readpos && + !php_stream_is_filtered(src) && !php_stream_is_filtered(dest)) { + php_io_fd src_copy_fd, dest_copy_fd; + + if (php_stream_cast(src, PHP_STREAM_AS_FD_FOR_COPY, (void *) &src_copy_fd, 0) == SUCCESS && + php_stream_cast(dest, PHP_STREAM_AS_FD_FOR_COPY, (void *) &dest_copy_fd, 0) == SUCCESS) { + + /* copy_file_range does not work with O_APPEND */ + if (src_copy_fd.fd_type == PHP_IO_FD_FILE && dest_copy_fd.fd_type == PHP_IO_FD_FILE) { + int dest_flags = 0; + if (php_stream_parse_fopen_modes(dest->mode, &dest_flags) == SUCCESS + && (dest_flags & O_APPEND)) { + goto fallback; + } + } + + size_t io_maxlen = (maxlen == PHP_STREAM_COPY_ALL) ? PHP_IO_COPY_ALL : maxlen; + size_t copied = 0; + zend_result result = php_io_copy(&src_copy_fd, &dest_copy_fd, io_maxlen, &copied); + + src->position += copied; + dest->position += copied; + *len = copied; + return result; + } + } + +fallback: + return php_stream_copy_fallback(src, dest, maxlen, len); +} + /* Returns the number of bytes moved. * Returns 1 when source len is 0. * Deprecated in favor of php_stream_copy_to_stream_ex() */ diff --git a/main/streams/xp_socket.c b/main/streams/xp_socket.c index d18b0e901957..3eef731544de 100644 --- a/main/streams/xp_socket.c +++ b/main/streams/xp_socket.c @@ -15,7 +15,7 @@ #include "php.h" #include "ext/standard/file.h" #include "php_streams.h" -#include "php_network.h" +#include "php_io.h" #if defined(PHP_WIN32) || defined(__riscos__) # undef AF_UNIX @@ -523,11 +523,19 @@ static int php_sockop_cast(php_stream *stream, int castas, void **ret) if (ret) *(php_socket_t *)ret = sock->socket; return SUCCESS; + case PHP_STREAM_AS_FD_FOR_COPY: + if (ret) { + php_io_fd *copy_fd = (php_io_fd *) ret; + copy_fd->socket = sock->socket; + copy_fd->fd_type = PHP_IO_FD_SOCKET; + copy_fd->timeout = sock->timeout; + copy_fd->is_blocked = sock->is_blocked; + } + return SUCCESS; default: return FAILURE; } } -/* }}} */ /* These may look identical, but we need them this way so that * we can determine which type of socket we are dealing with diff --git a/tests/unit/Makefile b/tests/unit/Makefile index ae8eeb8ab3ed..778a03328238 100644 --- a/tests/unit/Makefile +++ b/tests/unit/Makefile @@ -3,9 +3,11 @@ CFLAGS = -g -Wall -I../../ -I../../Zend -I../../main -I../../TSRM -I. -I.. COMMON_LDFLAGS = ../../.libs/libphp.a -lcmocka -lpthread -lm -ldl -lresolv -lutil # Update paths in .github/workflows/unit-tests.yml when adding new test to make it run in PR when such file changes -TESTS = main/test_network +TESTS = main/test_network main/test_io_copy main/test_network_SRC = main/test_network.c main/test_network_LDFLAGS = $(COMMON_LDFLAGS) -Wl,--wrap=connect,--wrap=poll,--wrap=getsockopt,--wrap=gettimeofday +main/test_io_copy_SRC = main/test_io_copy.c +main/test_io_copy_LDFLAGS = $(COMMON_LDFLAGS) -Wl,--wrap=copy_file_range,--wrap=sendfile,--wrap=splice,--wrap=read,--wrap=write,--wrap=poll,--wrap=setsockopt # Build all tests diff --git a/tests/unit/main/test_io_copy.c b/tests/unit/main/test_io_copy.c new file mode 100644 index 000000000000..4de0d41227d7 --- /dev/null +++ b/tests/unit/main/test_io_copy.c @@ -0,0 +1,293 @@ +#include "php.h" +#include "io/php_io_internal.h" +#include +#include +#include +#include +#include + +/* Mocked syscalls return the value queued via will_return(); a negative value + * -E is translated to a -1 return with errno set to E. Must expand inside the + * wrapper body because cmocka keys the queued values by __func__. */ +#define MOCK_IO_RESULT(result_var) \ + ssize_t result_var = mock_type(ssize_t); \ + if (result_var < 0) { \ + errno = (int) -result_var; \ + result_var = -1; \ + } + +ssize_t __wrap_copy_file_range(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned int flags) +{ + function_called(); + MOCK_IO_RESULT(result); + return result; +} + +ssize_t __wrap_sendfile(int out_fd, int in_fd, off_t *offset, size_t count) +{ + function_called(); + MOCK_IO_RESULT(result); + return result; +} + +ssize_t __wrap_splice(int fd_in, off_t *off_in, int fd_out, off_t *off_out, size_t len, unsigned int flags) +{ + function_called(); + check_expected(len); + check_expected(flags); + MOCK_IO_RESULT(result); + return result; +} + +ssize_t __wrap_read(int fd, void *buf, size_t count) +{ + function_called(); + MOCK_IO_RESULT(result); + if (result > 0) { + memset(buf, 'x', result); + } + return result; +} + +ssize_t __wrap_write(int fd, const void *buf, size_t count) +{ + function_called(); + MOCK_IO_RESULT(result); + return result; +} + +int __wrap_poll(struct pollfd *ufds, nfds_t nfds, int timeout) +{ + function_called(); + check_expected(timeout); + + int n = mock_type(int); + if (n > 0) { + ufds->revents = POLLIN; + } else if (n < 0) { + errno = -n; + n = -1; + } + + return n; +} + +int __wrap_setsockopt(int fd, int level, int optname, const void *optval, socklen_t optlen) +{ + function_called(); + check_expected(optname); + return 0; +} + +/* Kernel MAX_RW_COUNT, must match PHP_IO_SPLICE_MAX in php_io_copy_linux.c */ +#define TEST_SPLICE_MAX ((size_t) 0x7ffff000) + +static php_io_fd make_io_fd(int fd, php_io_fd_type fd_type) +{ + php_io_fd io_fd = { + .fd = fd, + .fd_type = fd_type, + .timeout = { .tv_sec = -1, .tv_usec = 0 }, + .is_blocked = 0, + }; + return io_fd; +} + +/* file -> file: a hard error after partial progress must report FAILURE + * together with the bytes already copied */ +static void test_file_to_file_error_after_partial(void **state) +{ + php_io_fd src = make_io_fd(10, PHP_IO_FD_FILE); + php_io_fd dest = make_io_fd(11, PHP_IO_FD_FILE); + size_t copied = 0; + + expect_function_calls(__wrap_copy_file_range, 2); + will_return(__wrap_copy_file_range, 4096); + will_return(__wrap_copy_file_range, -ENOSPC); + + assert_int_equal(php_io_linux_copy(&src, &dest, PHP_IO_COPY_ALL, &copied), FAILURE); + assert_int_equal(copied, 4096); +} + +/* file -> file: EXDEV with no progress falls back to the read/write loop */ +static void test_file_to_file_exdev_fallback(void **state) +{ + php_io_fd src = make_io_fd(10, PHP_IO_FD_FILE); + php_io_fd dest = make_io_fd(11, PHP_IO_FD_FILE); + size_t copied = 0; + + expect_function_call(__wrap_copy_file_range); + will_return(__wrap_copy_file_range, -EXDEV); + + expect_function_call(__wrap_read); + will_return(__wrap_read, 100); + expect_function_call(__wrap_write); + will_return(__wrap_write, 100); + expect_function_call(__wrap_read); + will_return(__wrap_read, 0); + + assert_int_equal(php_io_linux_copy(&src, &dest, PHP_IO_COPY_ALL, &copied), SUCCESS); + assert_int_equal(copied, 100); +} + +/* the generic fallback loop must retry interrupted read() and write() */ +static void test_generic_fallback_eintr_retry(void **state) +{ + size_t copied = 0; + + expect_function_calls(__wrap_read, 2); + will_return(__wrap_read, -EINTR); + will_return(__wrap_read, 50); + expect_function_calls(__wrap_write, 2); + will_return(__wrap_write, -EINTR); + will_return(__wrap_write, 50); + expect_function_call(__wrap_read); + will_return(__wrap_read, 0); + + assert_int_equal(php_io_generic_copy_fallback(10, 11, PHP_IO_COPY_ALL, &copied), SUCCESS); + assert_int_equal(copied, 50); +} + +/* the generic fallback loop must report FAILURE with the partial count when a + * write fails mid-copy */ +static void test_generic_fallback_write_error_after_partial(void **state) +{ + size_t copied = 0; + + expect_function_call(__wrap_read); + will_return(__wrap_read, 50); + expect_function_call(__wrap_write); + will_return(__wrap_write, 50); + expect_function_call(__wrap_read); + will_return(__wrap_read, 50); + expect_function_call(__wrap_write); + will_return(__wrap_write, -ENOSPC); + + assert_int_equal(php_io_generic_copy_fallback(10, 11, PHP_IO_COPY_ALL, &copied), FAILURE); + assert_int_equal(copied, 50); +} + +/* file -> socket: a hard sendfile error after partial progress must report + * FAILURE together with the bytes already sent */ +static void test_file_to_socket_sendfile_error_after_partial(void **state) +{ + php_io_fd src = make_io_fd(10, PHP_IO_FD_FILE); + php_io_fd dest = make_io_fd(11, PHP_IO_FD_SOCKET); + size_t copied = 0; + + expect_function_calls(__wrap_sendfile, 2); + will_return(__wrap_sendfile, 8192); + will_return(__wrap_sendfile, -EPIPE); + + assert_int_equal(php_io_linux_copy(&src, &dest, PHP_IO_COPY_ALL, &copied), FAILURE); + assert_int_equal(copied, 8192); +} + +/* file -> socket: sendfile EINVAL with no progress falls back to the + * read/write loop */ +static void test_file_to_socket_sendfile_einval_fallback(void **state) +{ + php_io_fd src = make_io_fd(10, PHP_IO_FD_FILE); + php_io_fd dest = make_io_fd(11, PHP_IO_FD_SOCKET); + size_t copied = 0; + + expect_function_call(__wrap_sendfile); + will_return(__wrap_sendfile, -EINVAL); + + expect_function_call(__wrap_read); + will_return(__wrap_read, 10); + expect_function_call(__wrap_write); + will_return(__wrap_write, 10); + expect_function_call(__wrap_read); + will_return(__wrap_read, 0); + + assert_int_equal(php_io_linux_copy(&src, &dest, PHP_IO_COPY_ALL, &copied), SUCCESS); + assert_int_equal(copied, 10); +} + +/* socket -> file: a blocking source socket must be polled with the stream + * timeout and a timeout is a clean stop, not an error */ +static void test_socket_source_poll_timeout(void **state) +{ + php_io_fd src = make_io_fd(10, PHP_IO_FD_SOCKET); + php_io_fd dest = make_io_fd(11, PHP_IO_FD_FILE); + size_t copied = 42; + + src.is_blocked = 1; + src.timeout.tv_sec = 2; + src.timeout.tv_usec = 500000; + + expect_function_call(__wrap_poll); + expect_value(__wrap_poll, timeout, 2500); + will_return(__wrap_poll, 0); + + assert_int_equal(php_io_linux_copy(&src, &dest, PHP_IO_COPY_ALL, &copied), SUCCESS); + assert_int_equal(copied, 0); +} + +/* pipe -> socket: splices are corked with SPLICE_F_MORE and capped at the + * kernel MAX_RW_COUNT; an error after partial progress must report FAILURE + * with the partial count and still clear the cork */ +static void test_pipe_to_socket_splice_error_after_partial_uncorks(void **state) +{ + php_io_fd src = make_io_fd(10, PHP_IO_FD_PIPE); + php_io_fd dest = make_io_fd(11, PHP_IO_FD_SOCKET); + size_t copied = 0; + + expect_function_calls(__wrap_splice, 2); + expect_value_count(__wrap_splice, len, TEST_SPLICE_MAX, 2); + expect_value_count(__wrap_splice, flags, SPLICE_F_MORE, 2); + will_return(__wrap_splice, 1000); + will_return(__wrap_splice, -EPIPE); + + expect_function_call(__wrap_setsockopt); + expect_value(__wrap_setsockopt, optname, TCP_CORK); + + assert_int_equal(php_io_linux_copy(&src, &dest, PHP_IO_COPY_ALL, &copied), FAILURE); + assert_int_equal(copied, 1000); +} + +/* socket -> file: when the outbound splice fails, the data already sitting in + * the intermediate pipe is salvaged with a read/write loop (retrying EINTR) + * and the copy reports FAILURE with the salvaged count */ +static void test_socket_to_file_splice_out_error_drains_pipe(void **state) +{ + php_io_fd src = make_io_fd(10, PHP_IO_FD_SOCKET); + php_io_fd dest = make_io_fd(11, PHP_IO_FD_FILE); + size_t copied = 0; + + expect_function_calls(__wrap_splice, 2); + /* socket -> pipe */ + expect_value(__wrap_splice, len, SSIZE_MAX); + expect_value(__wrap_splice, flags, 0); + will_return(__wrap_splice, 500); + /* pipe -> file */ + expect_value(__wrap_splice, len, 500); + expect_value(__wrap_splice, flags, 0); + will_return(__wrap_splice, -EINVAL); + + expect_function_calls(__wrap_read, 2); + will_return(__wrap_read, -EINTR); + will_return(__wrap_read, 500); + expect_function_call(__wrap_write); + will_return(__wrap_write, 500); + + assert_int_equal(php_io_linux_copy(&src, &dest, PHP_IO_COPY_ALL, &copied), FAILURE); + assert_int_equal(copied, 500); +} + +int main(void) +{ + const struct CMUnitTest tests[] = { + cmocka_unit_test(test_file_to_file_error_after_partial), + cmocka_unit_test(test_file_to_file_exdev_fallback), + cmocka_unit_test(test_generic_fallback_eintr_retry), + cmocka_unit_test(test_generic_fallback_write_error_after_partial), + cmocka_unit_test(test_file_to_socket_sendfile_error_after_partial), + cmocka_unit_test(test_file_to_socket_sendfile_einval_fallback), + cmocka_unit_test(test_socket_source_poll_timeout), + cmocka_unit_test(test_pipe_to_socket_splice_error_after_partial_uncorks), + cmocka_unit_test(test_socket_to_file_splice_out_error_drains_pipe), + }; + return cmocka_run_group_tests(tests, NULL, NULL); +} diff --git a/win32/build/config.w32 b/win32/build/config.w32 index 8ec6b31a11a0..012c52499b64 100644 --- a/win32/build/config.w32 +++ b/win32/build/config.w32 @@ -298,6 +298,9 @@ AC_DEFINE('HAVE_STRNLEN', 1); AC_DEFINE('ZEND_CHECK_STACK_LIMIT', 1) +ADD_SOURCES("main/io", "php_io.c php_io_copy_windows.c"); +ADD_FLAG("CFLAGS_BD_MAIN_IO", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); + ADD_SOURCES("main/poll", "poll_backend_wsapoll.c poll_core.c poll_fd_table.c poll_handle.c"); ADD_FLAG("CFLAGS_BD_MAIN_POLL", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); @@ -312,7 +315,7 @@ ADD_SOURCES("win32", "dllmain.c readdir.c \ ADD_FLAG("CFLAGS_BD_WIN32", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); -PHP_INSTALL_HEADERS("", "Zend/ TSRM/ main/ main/streams/ win32/"); +PHP_INSTALL_HEADERS("", "Zend/ TSRM/ main/ main/io main/streams/ win32/"); PHP_INSTALL_HEADERS("Zend/Optimizer", "zend_call_graph.h zend_cfg.h zend_dfg.h zend_dump.h zend_func_info.h zend_inference.h zend_optimizer.h zend_ssa.h zend_worklist.h"); STDOUT.WriteBlankLines(1); diff --git a/win32/build/confutils.js b/win32/build/confutils.js index 3751101daa4b..7d9297e8c2d6 100644 --- a/win32/build/confutils.js +++ b/win32/build/confutils.js @@ -3523,7 +3523,7 @@ function toolset_setup_common_ldflags() function toolset_setup_common_libs() { // urlmon.lib ole32.lib oleaut32.lib uuid.lib gdi32.lib winspool.lib comdlg32.lib - DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib psapi.lib bcrypt.lib Pathcch.lib"); + DEFINE("LIBS", "kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib psapi.lib bcrypt.lib Pathcch.lib Mswsock.lib"); } function toolset_setup_build_mode() From cfbe114468be9d0c66e41bb44f355dc95f6578b7 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 19 Jul 2026 16:17:09 +0100 Subject: [PATCH 04/15] Add UPGRADING.INTERNALS entry after function removal --- UPGRADING.INTERNALS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 72ee0a1b2bed..237c3cb23781 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -140,6 +140,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES file descriptors using the most efficient platform primitive available (sendfile, splice, copy_file_range, TransmitFile), and is now used by php_stream_copy_to_stream_ex(). The mmap-based copy fallback was removed. + . The {_}php_stream_fopen_with_path() functions have been removed as they are + unused. ======================== 2. Build system changes From fdc5b8f952cf5ea2a1b9b838f8e36847e2f76b1b Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 19 Jul 2026 16:40:18 +0100 Subject: [PATCH 05/15] Reorganise UPGRADING.INTERNALS to be more legible (#22808) Split API changes into Removed, Changed, and Added --- UPGRADING.INTERNALS | 109 +++++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 52 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 237c3cb23781..fe6946faddd1 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -14,13 +14,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES 1. Internal API changes ======================== - . ZSTR_INIT_LITERAL(), zend_string_starts_with_literal(), and - zend_string_starts_with_literal_ci() now support strings containing NUL - bytes. Passing non-literal char* is no longer supported. - . Added zend_string_equals_cstr_ci(). +- Removed: . The misnamed ZVAL_IS_NULL() has been removed. Use Z_ISNULL() instead. - . New zend_class_entry.ce_flags2 and zend_function.fn_flags2 fields were - added, given the primary flags were running out of bits. . The zval_is_true() alias of zend_is_true() has been removed. Call zend_is_true() directly instead. . The _zval_get_*() compatibility macros for PHP 7.2 have been removed @@ -42,45 +37,13 @@ PHP 8.6 INTERNALS UPGRADE NOTES needs to be obtained use the zend_get_callable_zval_from_fcc() function instead. If this was used to store a callable, then an FCC should be stored instead. - . The zend_active_function{_ex}() functions now return a const zend_function - pointer. - . The zend_get_call_trampoline_func() API now takes the __call or - __callStatic zend_function* instead of a CE and a boolean argument. + . The zend_exception_save() and zend_exception_restore() functions were + removed. . The zend_set_hash_symbol() API has been removed. - . Added zend_hash_str_lookup(). . The WRONG_PARAM_COUNT and ZEND_WRONG_PARAM_COUNT() macros have been removed. Call zend_wrong_param_count(); followed by RETURN_THROWS(); instead. . PHP_HAVE_STREAMS macro removed from . - . zend_function.arg_info is now always a zend_arg_info*. Before, it was a - zend_internal_arg_info on internal functions, unless the - ZEND_ACC_USER_ARG_INFO flag was set. - . Added zend_ast_call_get_args() to fetch the argument node from any call - node. - . The zend_exception_save() and zend_exception_restore() functions were - removed. - . Internal functions that return by reference are now expected to - automatically unwrap references when the result of the call is stored in an - IS_TMP_VAR variable. This may be achieved by calling the - zend_return_unwrap_ref() function. - . The php_math_round_mode_from_enum() function now takes a - zend_enum_RoundingMode parameter. - . Added Z_PARAM_ENUM(). - . Added zend_enum_fetch_case_id(). - . Added zend_enum_get_case_by_id(). - . Added zend_bin2hex() and zend_bin2hex_str() as helper functions to remove - dependencies on /ext/hash in various extensions. - . ZEND_INI_GET_ADDR() is now a void* pointer instead of a char* pointer. This - more correctly represents the generic nature of the returned pointer and - allows to remove explicit casts, but possibly breaks pointer arithmetic - performed on the result. - . The zend_dval_to_lval_cap() function no longer takes a second - zend_string* parameter. - . EG(in_autoload) was renamed to EG(autoload_current_classnames) and no - longer is a pointer, but a directly embedded HashTable struct. - . Added a C23_ENUM() helper macro to define forward-compatible fixed-size - enums. - . Extended php_stream_filter_ops with seek method. . The INI_STR(), INI_INT(), INI_FLT(), and INI_BOOL() macros have been removed. Instead new zend_ini_{bool|long|double|str|string}_literal() macros have been added. This fixes an internal naming inconsistency as @@ -90,13 +53,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES unused. If this behaviour is required fall back to the zend_ini_* functions. . The unused ZEND_AST_PARENT_PROPERTY_HOOK_CALL has been removed. - . ZEND_AST_METHOD_REFERENCE has been renamed to - ZEND_AST_TRAIT_METHOD_REFERENCE. . The EMPTY_SWITCH_DEFAULT_CASE() macro has been removed. Use default: ZEND_UNREACHABLE(); instead. - . Functions using zend_forbid_dynamic_call() *must* be flagged with - ZEND_ACC2_FORBID_DYN_CALLS (@forbid-dynamic-calls in stubs). In debug - builds, failing to include that flag will lead to assertion failures. . The ZEND_RESULT_CODE type has been removed. Use zend_result directly. . The zend_parse_parameters_none_throw(), zend_parse_parameters_throw(), and ZEND_PARSE_PARAMS_THROW have been removed due to being misleading, @@ -115,16 +73,63 @@ PHP 8.6 INTERNALS UPGRADE NOTES have been removed, because they are unsafe by relying on the zvals having a specific type. Use zend_binary_strcmp() / zend_binary_strncmp(), string_compare_function() or similar instead. - . Added zend_fcall_info.consumed_args together with - zend_fci_consumed_arg(), which allows moving a selected callback argument - instead of copying it in zend_call_function(). Currently only a single - consumed argument is supported. - . Added ZEND_CONTAINER_OF(). . The OPENBASEDIR_CHECKPATH() compatibility macro has been removed, instead use php_check_open_basedir() directly. . The Z_CONSTANT(), Z_CONSTANT_P(), Z_OPT_CONSTANT(), and Z_OPT_CONSTANT_P() macros have been removed. Check for IS_CONSTANT_AST directly. + . The {_}php_stream_fopen_with_path() functions have been removed as they are + unused. + +- Changed: + . Internal functions that return by reference are now expected to + automatically unwrap references when the result of the call is stored in an + IS_TMP_VAR variable. This may be achieved by calling the + zend_return_unwrap_ref() function. + . ZEND_AST_METHOD_REFERENCE has been renamed to + ZEND_AST_TRAIT_METHOD_REFERENCE. + . Functions using zend_forbid_dynamic_call() *must* be flagged with + ZEND_ACC2_FORBID_DYN_CALLS (@forbid-dynamic-calls in stubs). In debug + builds, failing to include that flag will lead to assertion failures. + . The zend_get_call_trampoline_func() API now takes the __call or + __callStatic zend_function* instead of a CE and a boolean argument. + . ZSTR_INIT_LITERAL(), zend_string_starts_with_literal(), and + zend_string_starts_with_literal_ci() now support strings containing NUL + bytes. Passing non-literal char* is no longer supported. + . Added zend_string_equals_cstr_ci(). + . The zend_active_function{_ex}() functions now return a const zend_function + pointer. + . zend_function.arg_info is now always a zend_arg_info*. Before, it was a + zend_internal_arg_info on internal functions, unless the + ZEND_ACC_USER_ARG_INFO flag was set. + . ZEND_INI_GET_ADDR() is now a void* pointer instead of a char* pointer. This + more correctly represents the generic nature of the returned pointer and + allows to remove explicit casts, but possibly breaks pointer arithmetic + performed on the result. + . The zend_dval_to_lval_cap() function no longer takes a second + zend_string* parameter. + . EG(in_autoload) was renamed to EG(autoload_current_classnames) and no + longer is a pointer, but a directly embedded HashTable struct. + . Extended php_stream_filter_ops with seek method. + +- Added: + . New zend_class_entry.ce_flags2 and zend_function.fn_flags2 fields were + added, given the primary flags were running out of bits. + . Added zend_hash_str_lookup(). + . Added zend_ast_call_get_args() to fetch the argument node from any call + node. + . Added Z_PARAM_ENUM(). + . Added zend_enum_fetch_case_id(). + . Added zend_enum_get_case_by_id(). + . Added zend_bin2hex() and zend_bin2hex_str() as helper functions to remove + dependencies on /ext/hash in various extensions. + . Added a C23_ENUM() helper macro to define forward-compatible fixed-size + enums. + . Added zend_fcall_info.consumed_args together with + zend_fci_consumed_arg(), which allows moving a selected callback argument + instead of copying it in zend_call_function(). Currently only a single + consumed argument is supported. + . Added ZEND_CONTAINER_OF(). . Added zend_reflection_property_set_raw_value_without_lazy_initialization(), zend_reflection_property_set_raw_value() to expose the functionality of ReflectionProperty::setRawValueWithoutLazyInitialization() and @@ -140,8 +145,6 @@ PHP 8.6 INTERNALS UPGRADE NOTES file descriptors using the most efficient platform primitive available (sendfile, splice, copy_file_range, TransmitFile), and is now used by php_stream_copy_to_stream_ex(). The mmap-based copy fallback was removed. - . The {_}php_stream_fopen_with_path() functions have been removed as they are - unused. ======================== 2. Build system changes @@ -225,6 +228,8 @@ PHP 8.6 INTERNALS UPGRADE NOTES . _php_error_log() now accepts zend_string* values instead of char*. . _php_error_log_ex() has been removed. . php_mail()'s extra_cmd parameter is now a zend_string*. + . The php_math_round_mode_from_enum() function now takes a + zend_enum_RoundingMode parameter. - ext/uri: . The value parameter of the php_uri_property_handler_write callback is now From e10141588ac5446851386a04a96d638cf0a0e681 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 19 Jul 2026 17:15:32 +0100 Subject: [PATCH 06/15] stream: improve bugfix, check class is instantiable prior to registering (#22806) Rather than when attempting to create an instance of it within the stream layer. --- ext/standard/tests/streams/bug74951.phpt | 12 ++++++++---- main/streams/userspace.c | 10 ++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ext/standard/tests/streams/bug74951.phpt b/ext/standard/tests/streams/bug74951.phpt index b30b5fe2824e..2668f541fb3c 100644 --- a/ext/standard/tests/streams/bug74951.phpt +++ b/ext/standard/tests/streams/bug74951.phpt @@ -6,8 +6,12 @@ trait Stream00ploiter{ public function s() {} public function n($_) {} } -stream_wrapper_register('e0ploit','Stream00ploiter'); -$s=fopen('e0ploit://',0); + +try { + stream_wrapper_register('e0ploit','Stream00ploiter'); +} catch (\Throwable $e) { + echo $e::class, ': ', $e->getMessage(), \PHP_EOL; +} ?> ---EXPECTF-- -Warning: fopen(): Failed to open stream: operation failed in %s%ebug74951.php on line 7 +--EXPECT-- +ValueError: stream_wrapper_register(): Argument #2 ($class) must be a concrete class diff --git a/main/streams/userspace.c b/main/streams/userspace.c index bf6ffa500963..9b6f283c075d 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -249,10 +249,7 @@ typedef struct _php_userstream_data php_userstream_data_t; static void user_stream_create_object(struct php_user_stream_wrapper *uwrap, php_stream_context *context, zval *object) { - if (uwrap->ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { - ZVAL_UNDEF(object); - return; - } + ZEND_ASSERT((uwrap->ce->ce_flags & ZEND_ACC_UNINSTANTIABLE) == 0); /* create an instance of our class */ if (object_init_ex(object, uwrap->ce) == FAILURE) { @@ -467,6 +464,11 @@ PHP_FUNCTION(stream_wrapper_register) RETURN_THROWS(); } + if (UNEXPECTED(ce->ce_flags & ZEND_ACC_UNINSTANTIABLE)) { + zend_argument_value_error(2, "must be a concrete class"); + RETURN_THROWS(); + } + uwrap = (struct php_user_stream_wrapper *)ecalloc(1, sizeof(*uwrap)); uwrap->ce = ce; uwrap->wrapper.wops = &user_stream_wops; From 6455aab46fdaf4ee0e26f167f3b08b489786056d Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Fri, 17 Jul 2026 13:34:49 -0700 Subject: [PATCH 07/15] Reflection: integer types cleanup Use `uint32_t` for values that are really `uint32_t`, like constant module numbers and the result from `zend_hash_num_elements()`. Use `uint32_t` for counting up, when values should never be negative. Adjust format specifiers to use `PRIu32` rather than `%d` for the uint32_t values. --- ext/reflection/php_reflection.c | 54 ++++++++++++++++----------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 1c4e152d674e..a15f2440431b 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -375,7 +375,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const /* The information where a class is declared is only available for user classes */ if (ce->type == ZEND_USER_CLASS) { - smart_str_append_printf(str, "%s @@ %s %d-%d\n", indent, ZSTR_VAL(ce->info.user.filename), + smart_str_append_printf(str, "%s @@ %s %" PRIu32 "-%" PRIu32 "\n", indent, ZSTR_VAL(ce->info.user.filename), ce->info.user.line_start, ce->info.user.line_end); } @@ -410,12 +410,12 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const // Enum cases go first, but the heading is only shown if there are any if (enum_case_count) { smart_str_appendc(str, '\n'); - smart_str_append_printf(str, "%s - Enum cases [%d] {\n", indent, enum_case_count); + smart_str_append_printf(str, "%s - Enum cases [%" PRIu32 "] {\n", indent, enum_case_count); smart_str_append_smart_str(str, &enum_case_str); smart_str_append_printf(str, "%s }\n", indent); } smart_str_appendc(str, '\n'); - smart_str_append_printf(str, "%s - Constants [%d] {\n", indent, constant_count); + smart_str_append_printf(str, "%s - Constants [%" PRIu32 "] {\n", indent, constant_count); smart_str_append_smart_str(str, &constant_str); smart_str_append_printf(str, "%s }\n", indent); @@ -424,9 +424,9 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const /* Static properties */ /* counting static properties */ - int count = zend_hash_num_elements(&ce->properties_info); - int count_static_props = 0; - int count_shadow_props = 0; + uint32_t count = zend_hash_num_elements(&ce->properties_info); + uint32_t count_static_props = 0; + uint32_t count_shadow_props = 0; if (count > 0) { ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, zend_property_info *prop) { if ((prop->flags & ZEND_ACC_PRIVATE) && prop->ce != ce) { @@ -438,7 +438,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const } /* static properties */ - smart_str_append_printf(str, "\n%s - Static properties [%d] {\n", indent, count_static_props); + smart_str_append_printf(str, "\n%s - Static properties [%" PRIu32 "] {\n", indent, count_static_props); if (count_static_props > 0) { ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, zend_property_info *prop) { if ((prop->flags & ZEND_ACC_STATIC) && (!(prop->flags & ZEND_ACC_PRIVATE) || prop->ce == ce)) { @@ -451,7 +451,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const /* Static methods */ /* counting static methods */ count = zend_hash_num_elements(&ce->function_table); - int count_static_funcs = 0; + uint32_t count_static_funcs = 0; if (count > 0) { ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, zend_function *mptr) { if ((mptr->common.fn_flags & ZEND_ACC_STATIC) @@ -463,7 +463,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const } /* static methods */ - smart_str_append_printf(str, "\n%s - Static methods [%d] {", indent, count_static_funcs); + smart_str_append_printf(str, "\n%s - Static methods [%" PRIu32 "] {", indent, count_static_funcs); if (count_static_funcs > 0) { ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, zend_function *mptr) { if ((mptr->common.fn_flags & ZEND_ACC_STATIC) @@ -480,7 +480,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const /* Default/Implicit properties */ count = zend_hash_num_elements(&ce->properties_info) - count_static_props - count_shadow_props; - smart_str_append_printf(str, "\n%s - Properties [%d] {\n", indent, count); + smart_str_append_printf(str, "\n%s - Properties [%" PRIu32 "] {\n", indent, count); if (count > 0) { ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, zend_property_info *prop) { if (!(prop->flags & ZEND_ACC_STATIC) @@ -539,7 +539,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const _free_function(closure); } } ZEND_HASH_FOREACH_END(); - smart_str_append_printf(str, "\n%s - Methods [%d] {", indent, count); + smart_str_append_printf(str, "\n%s - Methods [%" PRIu32 "] {", indent, count); smart_str_append_smart_str(str, &method_str); if (!count) { smart_str_appendc(str, '\n'); @@ -749,7 +749,7 @@ static void format_default_value(smart_str *str, const zval *value) { /* {{{ _parameter_string */ static void _parameter_string(smart_str *str, const zend_function *fptr, const struct _zend_arg_info *arg_info, uint32_t offset, bool required) { - smart_str_append_printf(str, "Parameter #%d [ ", offset); + smart_str_append_printf(str, "Parameter #%" PRIu32 " [ ", offset); if (!required) { smart_str_appends(str, " "); } else { @@ -806,7 +806,7 @@ static void _function_parameter_string(smart_str *str, const zend_function *fptr uint32_t num_required = fptr->common.required_num_args; smart_str_appendc(str, '\n'); - smart_str_append_printf(str, "%s- Parameters [%d] {\n", indent, num_args); + smart_str_append_printf(str, "%s- Parameters [%" PRIu32 "] {\n", indent, num_args); for (uint32_t i = 0; i < num_args; i++) { smart_str_append_printf(str, "%s ", indent); _parameter_string(str, fptr, arg_info, i, i < num_required); @@ -832,10 +832,10 @@ static void _function_closure_string(smart_str *str, const zend_function *fptr, } smart_str_appendc(str, '\n'); - smart_str_append_printf(str, "%s- Bound Variables [%u] {\n", indent, count); + smart_str_append_printf(str, "%s- Bound Variables [%" PRIu32 "] {\n", indent, count); uint32_t i = 0; ZEND_HASH_MAP_FOREACH_STR_KEY(static_variables, const zend_string *key) { - smart_str_append_printf(str, "%s Variable #%d [ $%s ]\n", indent, i++, ZSTR_VAL(key)); + smart_str_append_printf(str, "%s Variable #%" PRIu32 " [ $%s ]\n", indent, i++, ZSTR_VAL(key)); } ZEND_HASH_FOREACH_END(); smart_str_append_printf(str, "%s}\n", indent); } @@ -929,7 +929,7 @@ static void _function_string(smart_str *str, const zend_function *fptr, const ze smart_str_append_printf(str, "%s ] {\n", ZSTR_VAL(fptr->common.function_name)); /* The information where a function is declared is only available for user classes */ if (fptr->type == ZEND_USER_FUNCTION) { - smart_str_append_printf(str, "%s @@ %s %d - %d\n", indent, + smart_str_append_printf(str, "%s @@ %s %" PRIu32 " - %" PRIu32 "\n", indent, ZSTR_VAL(fptr->op_array.filename), fptr->op_array.line_start, fptr->op_array.line_end); @@ -1113,7 +1113,7 @@ static void _extension_ini_string(const zend_ini_entry *ini_entry, smart_str *st } /* }}} */ -static void _extension_class_string(zend_class_entry *ce, zend_string *key, smart_str *str, const char *indent, const zend_module_entry *module, int *num_classes) /* {{{ */ +static void _extension_class_string(zend_class_entry *ce, zend_string *key, smart_str *str, const char *indent, const zend_module_entry *module, uint32_t *num_classes) /* {{{ */ { if (ce->type == ZEND_INTERNAL_CLASS && ce->info.internal.module @@ -1191,7 +1191,7 @@ static void _extension_string(smart_str *str, const zend_module_entry *module) / { smart_str str_constants = {0}; - int num_constants = 0; + uint32_t num_constants = 0; ZEND_HASH_MAP_FOREACH_PTR(EG(zend_constants), zend_constant *constant) { if (ZEND_CONSTANT_MODULE_NUMBER(constant) == module->module_number) { @@ -1201,7 +1201,7 @@ static void _extension_string(smart_str *str, const zend_module_entry *module) / } ZEND_HASH_FOREACH_END(); if (num_constants) { - smart_str_append_printf(str, "\n - Constants [%d] {\n", num_constants); + smart_str_append_printf(str, "\n - Constants [%" PRIu32 "] {\n", num_constants); smart_str_append_smart_str(str, &str_constants); smart_str_appends(str, " }\n"); } @@ -1229,13 +1229,13 @@ static void _extension_string(smart_str *str, const zend_module_entry *module) / { smart_str str_classes = {0}; - int num_classes = 0; + uint32_t num_classes = 0; ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(EG(class_table), zend_string *key, zend_class_entry *ce) { _extension_class_string(ce, key, &str_classes, " ", module, &num_classes); } ZEND_HASH_FOREACH_END(); if (num_classes) { - smart_str_append_printf(str, "\n - Classes [%d] {", num_classes); + smart_str_append_printf(str, "\n - Classes [%" PRIu32 "] {", num_classes); smart_str_append_smart_str(str, &str_classes); smart_str_appends(str, " }\n"); } @@ -4961,7 +4961,7 @@ ZEND_METHOD(ReflectionClass, newInstance) } zval *params; - int num_args; + uint32_t num_args; HashTable *named_params; ZEND_PARSE_PARAMETERS_START(0, -1) Z_PARAM_VARIADIC_WITH_NAMED(params, num_args, named_params) @@ -5013,7 +5013,7 @@ ZEND_METHOD(ReflectionClass, newInstanceArgs) RETURN_THROWS(); } - int argc = 0; + uint32_t argc = 0; if (args) { argc = zend_hash_num_elements(args); } @@ -7334,10 +7334,10 @@ ZEND_METHOD(ReflectionAttribute, __toString) if (attr->data->argc > 0) { smart_str_appends(&str, " {\n"); - smart_str_append_printf(&str, " - Arguments [%d] {\n", attr->data->argc); + smart_str_append_printf(&str, " - Arguments [%" PRIu32 "] {\n", attr->data->argc); for (uint32_t i = 0; i < attr->data->argc; i++) { - smart_str_append_printf(&str, " Argument #%d [ ", i); + smart_str_append_printf(&str, " Argument #%" PRIu32 " [ ", i); if (attr->data->args[i].name != NULL) { smart_str_append(&str, attr->data->args[i].name); smart_str_appends(&str, " = "); @@ -7984,7 +7984,7 @@ static void reflection_constant_find_ext(INTERNAL_FUNCTION_PARAMETERS, bool only ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(const_); - int module_number = ZEND_CONSTANT_MODULE_NUMBER(const_); + uint32_t module_number = ZEND_CONSTANT_MODULE_NUMBER(const_); if (module_number == PHP_USER_CONSTANT) { // For user constants, ReflectionConstant::getExtension() returns null, // ReflectionConstant::getExtensionName() returns false @@ -8007,7 +8007,7 @@ static void reflection_constant_find_ext(INTERNAL_FUNCTION_PARAMETERS, bool only zend_throw_exception_ex( reflection_exception_ptr, 0, - "Unable to locate extension with module_number %d that provides constant %s", + "Unable to locate extension with module_number %" PRIu32 " that provides constant %s", module_number, ZSTR_VAL(const_->name) ); From 07b5905d7f94a4538cdd3329673155c902aba182 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Fri, 17 Jul 2026 14:30:06 -0700 Subject: [PATCH 08/15] Reflection: mark a whole bunch of pointers as `const` --- ext/reflection/php_reflection.c | 780 ++++++++++++++++---------------- 1 file changed, 390 insertions(+), 390 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index a15f2440431b..072c8f4c3e2b 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -133,7 +133,7 @@ typedef struct _property_reference { typedef struct _parameter_reference { uint32_t offset; bool required; - struct _zend_arg_info *arg_info; + const struct _zend_arg_info *arg_info; zend_function *fptr; } parameter_reference; @@ -291,7 +291,7 @@ static zend_object *reflection_objects_new(zend_class_entry *class_type) /* {{{ } /* }}} */ -static void _const_string(smart_str *str, const zend_string *name, zval *value, const char *indent); +static void _const_string(smart_str *str, const zend_string *name, const zval *value, const char *indent); static void _function_string(smart_str *str, const zend_function *fptr, const zend_class_entry *scope, const char* indent); static void _property_string(smart_str *str, const zend_property_info *prop, const zend_string *prop_name, const char* indent); static void _class_const_string(smart_str *str, const zend_string *name, zend_class_constant *c, const char* indent); @@ -313,7 +313,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const if (obj && Z_TYPE_P(obj) == IS_OBJECT) { smart_str_append_printf(str, "%sObject of class [ ", indent); } else { - char *kind = "Class"; + const char *kind = "Class"; if (ce->ce_flags & ZEND_ACC_INTERFACE) { kind = "Interface"; } else if (ce->ce_flags & ZEND_ACC_TRAIT) { @@ -556,7 +556,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const /* }}} */ /* {{{ _const_string */ -static void _const_string(smart_str *str, const zend_string *name, zval *value, const char *indent) +static void _const_string(smart_str *str, const zend_string *name, const zval *value, const char *indent) { uint32_t flags = Z_CONSTANT_FLAGS_P(value); @@ -792,9 +792,9 @@ static void _parameter_string(smart_str *str, const zend_function *fptr, const s /* }}} */ /* {{{ _function_parameter_string */ -static void _function_parameter_string(smart_str *str, const zend_function *fptr, char* indent) +static void _function_parameter_string(smart_str *str, const zend_function *fptr, const char* indent) { - struct _zend_arg_info *arg_info = fptr->common.arg_info; + const struct _zend_arg_info *arg_info = fptr->common.arg_info; if (!arg_info) { return; } @@ -1078,7 +1078,7 @@ static void _extension_ini_string(const zend_ini_entry *ini_entry, smart_str *st if (ini_entry->modifiable == ZEND_INI_ALL) { smart_str_appends(str, "ALL"); } else { - char *comma = ""; + const char *comma = ""; if (ini_entry->modifiable & ZEND_INI_USER) { smart_str_appends(str, "USER"); comma = ","; @@ -1193,7 +1193,7 @@ static void _extension_string(smart_str *str, const zend_module_entry *module) / smart_str str_constants = {0}; uint32_t num_constants = 0; - ZEND_HASH_MAP_FOREACH_PTR(EG(zend_constants), zend_constant *constant) { + ZEND_HASH_MAP_FOREACH_PTR(EG(zend_constants), const zend_constant *constant) { if (ZEND_CONSTANT_MODULE_NUMBER(constant) == module->module_number) { _const_string(&str_constants, constant->name, &constant->value, " "); num_constants++; @@ -1380,8 +1380,8 @@ static void _zend_extension_string(smart_str *str, const zend_extension *extensi /* {{{ _function_check_flag */ static void _function_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) { - reflection_object *intern; - zend_function *mptr; + const reflection_object *intern; + const zend_function *mptr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(mptr); @@ -1416,7 +1416,7 @@ static void reflection_extension_factory(zval *object, zend_module_entry *module /* }}} */ /* {{{ reflection_parameter_factory */ -static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, struct _zend_arg_info *arg_info, uint32_t offset, bool required, zval *object) +static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, const struct _zend_arg_info *arg_info, uint32_t offset, bool required, zval *object) { object_init_ex(object, reflection_parameter_ptr); reflection_object *intern = Z_REFLECTION_P(object); @@ -1736,8 +1736,8 @@ ZEND_METHOD(ReflectionFunction, __construct) /* {{{ Returns a string representation */ ZEND_METHOD(ReflectionFunction, __toString) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; smart_str str = {0}; ZEND_PARSE_PARAMETERS_NONE(); @@ -1750,8 +1750,8 @@ ZEND_METHOD(ReflectionFunction, __toString) /* {{{ Returns this function's name */ ZEND_METHOD(ReflectionFunctionAbstract, getName) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -1763,8 +1763,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getName) /* {{{ Returns whether this is a closure */ ZEND_METHOD(ReflectionFunctionAbstract, isClosure) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -1793,7 +1793,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getClosureThis) /* {{{ Returns the scope associated to the closure */ ZEND_METHOD(ReflectionFunctionAbstract, getClosureScopeClass) { - reflection_object *intern; + const reflection_object *intern; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT(); @@ -1809,7 +1809,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getClosureScopeClass) /* {{{ Returns the called scope associated to the closure */ ZEND_METHOD(ReflectionFunctionAbstract, getClosureCalledClass) { - reflection_object *intern; + const reflection_object *intern; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT(); @@ -1830,7 +1830,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getClosureCalledClass) /* {{{ Returns an associative array containing the closures lexical scope variables */ ZEND_METHOD(ReflectionFunctionAbstract, getClosureUsedVariables) { - reflection_object *intern; + const reflection_object *intern; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT(); @@ -1849,14 +1849,14 @@ ZEND_METHOD(ReflectionFunctionAbstract, getClosureUsedVariables) const zend_op_array *ops = &closure_func->op_array; - HashTable *static_variables = ZEND_MAP_PTR_GET(ops->static_variables_ptr); + const HashTable *static_variables = ZEND_MAP_PTR_GET(ops->static_variables_ptr); if (!static_variables) { RETURN_EMPTY_ARRAY(); } array_init(return_value); - zend_op *opline = ops->opcodes + ops->num_args; + const zend_op *opline = ops->opcodes + ops->num_args; if (ops->fn_flags & ZEND_ACC_VARIADIC) { opline++; } @@ -1882,7 +1882,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getClosureUsedVariables) /* {{{ Returns a dynamically created closure for the function */ ZEND_METHOD(ReflectionFunction, getClosure) { - reflection_object *intern; + const reflection_object *intern; zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -1900,8 +1900,8 @@ ZEND_METHOD(ReflectionFunction, getClosure) /* {{{ Returns whether this is an internal function */ ZEND_METHOD(ReflectionFunctionAbstract, isInternal) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(fptr); @@ -1912,8 +1912,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, isInternal) /* {{{ Returns whether this is a user-defined function */ ZEND_METHOD(ReflectionFunctionAbstract, isUserDefined) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(fptr); @@ -1924,8 +1924,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, isUserDefined) /* {{{ Returns whether this function is an anonymous closure or not */ ZEND_METHOD(ReflectionFunction, isAnonymous) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -1947,8 +1947,8 @@ ZEND_METHOD(ReflectionFunction, isDisabled) /* {{{ Returns the filename of the file this function was declared in */ ZEND_METHOD(ReflectionFunctionAbstract, getFileName) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(fptr); @@ -1962,8 +1962,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getFileName) /* {{{ Returns the line this function's declaration starts at */ ZEND_METHOD(ReflectionFunctionAbstract, getStartLine) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(fptr); @@ -1977,8 +1977,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getStartLine) /* {{{ Returns the line this function's declaration ends at */ ZEND_METHOD(ReflectionFunctionAbstract, getEndLine) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(fptr); @@ -1992,8 +1992,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getEndLine) /* {{{ Returns the doc comment for this function */ ZEND_METHOD(ReflectionFunctionAbstract, getDocComment) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -2010,8 +2010,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getDocComment) /* {{{ Returns the attributes of this function */ ZEND_METHOD(ReflectionFunctionAbstract, getAttributes) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; GET_REFLECTION_OBJECT_PTR(fptr); @@ -2031,7 +2031,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getAttributes) /* {{{ Returns an associative array containing this function's static variables and their values */ ZEND_METHOD(ReflectionFunctionAbstract, getStaticVariables) { - reflection_object *intern; + const reflection_object *intern; zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -2058,7 +2058,7 @@ ZEND_METHOD(ReflectionFunction, invoke) zval *params; uint32_t num_args; HashTable *named_params; - reflection_object *intern; + const reflection_object *intern; zend_function *fptr; ZEND_PARSE_PARAMETERS_START(0, -1) @@ -2090,7 +2090,7 @@ ZEND_METHOD(ReflectionFunction, invoke) /* {{{ Invokes the function and pass its arguments as array. */ ZEND_METHOD(ReflectionFunction, invokeArgs) { - reflection_object *intern; + const reflection_object *intern; zend_function *fptr; HashTable *params; @@ -2123,8 +2123,8 @@ ZEND_METHOD(ReflectionFunction, invokeArgs) /* {{{ Gets whether this function returns a reference */ ZEND_METHOD(ReflectionFunctionAbstract, returnsReference) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -2137,8 +2137,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, returnsReference) /* {{{ Gets the number of parameters */ ZEND_METHOD(ReflectionFunctionAbstract, getNumberOfParameters) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -2156,8 +2156,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getNumberOfParameters) /* {{{ Gets the number of required parameters */ ZEND_METHOD(ReflectionFunctionAbstract, getNumberOfRequiredParameters) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -2177,7 +2177,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getParameters) GET_REFLECTION_OBJECT_PTR(fptr); - struct _zend_arg_info *arg_info = fptr->common.arg_info; + const struct _zend_arg_info *arg_info = fptr->common.arg_info; uint32_t num_args = fptr->common.num_args; if (fptr->common.fn_flags & ZEND_ACC_VARIADIC) { num_args++; @@ -2209,8 +2209,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getParameters) /* {{{ Returns NULL or the extension the function belongs to */ ZEND_METHOD(ReflectionFunctionAbstract, getExtension) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -2220,7 +2220,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getExtension) RETURN_NULL(); } - zend_internal_function *internal = (zend_internal_function *)fptr; + const zend_internal_function *internal = (zend_internal_function *)fptr; if (internal->module) { reflection_extension_factory(return_value, internal->module); } else { @@ -2232,8 +2232,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getExtension) /* {{{ Returns false or the name of the extension the function belongs to */ ZEND_METHOD(ReflectionFunctionAbstract, getExtensionName) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -2243,7 +2243,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getExtensionName) RETURN_FALSE; } - zend_internal_function *internal = (zend_internal_function *)fptr; + const zend_internal_function *internal = (zend_internal_function *)fptr; if (internal->module) { RETURN_STRING(internal->module->name); } else { @@ -2318,8 +2318,8 @@ ZEND_METHOD(ReflectionGenerator, getTrace) /* {{{ */ ZEND_METHOD(ReflectionGenerator, getExecutingLine) { - zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj); - zend_execute_data *ex = generator->execute_data; + const zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj); + const zend_execute_data *ex = generator->execute_data; ZEND_PARSE_PARAMETERS_NONE(); @@ -2332,8 +2332,8 @@ ZEND_METHOD(ReflectionGenerator, getExecutingLine) /* {{{ */ ZEND_METHOD(ReflectionGenerator, getExecutingFile) { - zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj); - zend_execute_data *ex = generator->execute_data; + const zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj); + const zend_execute_data *ex = generator->execute_data; ZEND_PARSE_PARAMETERS_NONE(); @@ -2346,7 +2346,7 @@ ZEND_METHOD(ReflectionGenerator, getExecutingFile) /* {{{ */ ZEND_METHOD(ReflectionGenerator, getFunction) { - zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj); + const zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj); zend_function *func = generator->func; ZEND_PARSE_PARAMETERS_NONE(); @@ -2366,7 +2366,7 @@ ZEND_METHOD(ReflectionGenerator, getFunction) /* {{{ */ ZEND_METHOD(ReflectionGenerator, getThis) { - zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj); + const zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj); zend_execute_data *ex = generator->execute_data; ZEND_PARSE_PARAMETERS_NONE(); @@ -2398,7 +2398,7 @@ ZEND_METHOD(ReflectionGenerator, getExecutingGenerator) ZEND_METHOD(ReflectionGenerator, isClosed) { - zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj); + const zend_generator *generator = (zend_generator *) Z_OBJ(Z_REFLECTION_P(ZEND_THIS)->obj); zend_execute_data *ex = generator->execute_data; ZEND_PARSE_PARAMETERS_NONE(); @@ -2524,7 +2524,7 @@ ZEND_METHOD(ReflectionParameter, __construct) } /* Now, search for the parameter */ - struct _zend_arg_info *arg_info = fptr->common.arg_info; + const struct _zend_arg_info *arg_info = fptr->common.arg_info; uint32_t num_args = fptr->common.num_args; if (fptr->common.fn_flags & ZEND_ACC_VARIADIC) { num_args++; @@ -2595,8 +2595,8 @@ ZEND_METHOD(ReflectionParameter, __construct) /* {{{ Returns a string representation */ ZEND_METHOD(ReflectionParameter, __toString) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; smart_str str = {0}; ZEND_PARSE_PARAMETERS_NONE(); @@ -2610,8 +2610,8 @@ ZEND_METHOD(ReflectionParameter, __toString) /* {{{ Returns the doc comment for this parameter */ ZEND_METHOD(ReflectionParameter, getDocComment) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); @@ -2626,8 +2626,8 @@ ZEND_METHOD(ReflectionParameter, getDocComment) /* {{{ Returns this parameter's name */ ZEND_METHOD(ReflectionParameter, getName) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); @@ -2640,7 +2640,7 @@ ZEND_METHOD(ReflectionParameter, getName) ZEND_METHOD(ReflectionParameter, getDeclaringFunction) { reflection_object *intern; - parameter_reference *param; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2656,8 +2656,8 @@ ZEND_METHOD(ReflectionParameter, getDeclaringFunction) /* {{{ Returns in which class this parameter is defined (not the type of the parameter) */ ZEND_METHOD(ReflectionParameter, getDeclaringClass) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2671,8 +2671,8 @@ ZEND_METHOD(ReflectionParameter, getDeclaringClass) /* {{{ Returns this parameters's class hint or NULL if there is none */ ZEND_METHOD(ReflectionParameter, getClass) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2729,8 +2729,8 @@ ZEND_METHOD(ReflectionParameter, getClass) /* {{{ Returns whether parameter has a type */ ZEND_METHOD(ReflectionParameter, hasType) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2742,8 +2742,8 @@ ZEND_METHOD(ReflectionParameter, hasType) /* {{{ Returns the type associated with the parameter */ ZEND_METHOD(ReflectionParameter, getType) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2758,8 +2758,8 @@ ZEND_METHOD(ReflectionParameter, getType) /* {{{ Returns whether parameter MUST be an array */ ZEND_METHOD(ReflectionParameter, isArray) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2777,8 +2777,8 @@ ZEND_METHOD(ReflectionParameter, isArray) /* {{{ Returns whether parameter MUST be callable */ ZEND_METHOD(ReflectionParameter, isCallable) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2791,8 +2791,8 @@ ZEND_METHOD(ReflectionParameter, isCallable) /* {{{ Returns whether NULL is allowed as this parameter's value */ ZEND_METHOD(ReflectionParameter, allowsNull) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2805,8 +2805,8 @@ ZEND_METHOD(ReflectionParameter, allowsNull) /* {{{ Returns whether this parameter is passed to by reference */ ZEND_METHOD(ReflectionParameter, isPassedByReference) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2818,8 +2818,8 @@ ZEND_METHOD(ReflectionParameter, isPassedByReference) /* {{{ Returns whether this parameter can be passed by value */ ZEND_METHOD(ReflectionParameter, canBePassedByValue) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2832,8 +2832,8 @@ ZEND_METHOD(ReflectionParameter, canBePassedByValue) /* {{{ Get parameter attributes. */ ZEND_METHOD(ReflectionParameter, getAttributes) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; GET_REFLECTION_OBJECT_PTR(param); @@ -2848,8 +2848,8 @@ ZEND_METHOD(ReflectionParameter, getAttributes) /* {{{ Returns the index of the parameter, starting from 0 */ ZEND_METHOD(ReflectionParameter, getPosition) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2861,8 +2861,8 @@ ZEND_METHOD(ReflectionParameter, getPosition) /* {{{ Returns whether this parameter is an optional parameter */ ZEND_METHOD(ReflectionParameter, isOptional) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2874,8 +2874,8 @@ ZEND_METHOD(ReflectionParameter, isOptional) /* {{{ Returns whether the default value of this parameter is available */ ZEND_METHOD(ReflectionParameter, isDefaultValueAvailable) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); @@ -2893,8 +2893,8 @@ ZEND_METHOD(ReflectionParameter, isDefaultValueAvailable) /* {{{ Returns the default value of this parameter or throws an exception */ ZEND_METHOD(ReflectionParameter, getDefaultValue) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); @@ -2915,8 +2915,8 @@ ZEND_METHOD(ReflectionParameter, getDefaultValue) /* {{{ Returns whether the default value of this parameter is constant */ ZEND_METHOD(ReflectionParameter, isDefaultValueConstant) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); @@ -2945,8 +2945,8 @@ ZEND_METHOD(ReflectionParameter, isDefaultValueConstant) /* {{{ Returns the default value's constant name if default value is constant or null */ ZEND_METHOD(ReflectionParameter, getDefaultValueConstantName) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); @@ -2985,8 +2985,8 @@ ZEND_METHOD(ReflectionParameter, getDefaultValueConstantName) /* {{{ Returns whether this parameter is a variadic parameter */ ZEND_METHOD(ReflectionParameter, isVariadic) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -2998,8 +2998,8 @@ ZEND_METHOD(ReflectionParameter, isVariadic) /* {{{ Returns this constructor parameter has been promoted to a property */ ZEND_METHOD(ReflectionParameter, isPromoted) { - reflection_object *intern; - parameter_reference *param; + const reflection_object *intern; + const parameter_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -3011,8 +3011,8 @@ ZEND_METHOD(ReflectionParameter, isPromoted) /* {{{ Returns whether the type MAY be null */ ZEND_METHOD(ReflectionType, allowsNull) { - reflection_object *intern; - type_reference *param; + const reflection_object *intern; + const type_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -3035,8 +3035,8 @@ static zend_string *zend_named_reflection_type_to_string(zend_type type) { /* {{{ Return the text of the type hint */ ZEND_METHOD(ReflectionType, __toString) { - reflection_object *intern; - type_reference *param; + const reflection_object *intern; + const type_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -3048,8 +3048,8 @@ ZEND_METHOD(ReflectionType, __toString) /* {{{ Return the name of the type */ ZEND_METHOD(ReflectionNamedType, getName) { - reflection_object *intern; - type_reference *param; + const reflection_object *intern; + const type_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -3066,8 +3066,8 @@ ZEND_METHOD(ReflectionNamedType, getName) /* {{{ Returns whether type is a builtin type */ ZEND_METHOD(ReflectionNamedType, isBuiltin) { - reflection_object *intern; - type_reference *param; + const reflection_object *intern; + const type_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -3100,8 +3100,8 @@ static void append_type_mask(zval *return_value, uint32_t type_mask) { /* {{{ Returns the types that are part of this union type */ ZEND_METHOD(ReflectionUnionType, getTypes) { - reflection_object *intern; - type_reference *param; + const reflection_object *intern; + const type_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -3157,8 +3157,8 @@ ZEND_METHOD(ReflectionUnionType, getTypes) /* {{{ Returns the types that are part of this intersection type */ ZEND_METHOD(ReflectionIntersectionType, getTypes) { - reflection_object *intern; - type_reference *param; + const reflection_object *intern; + const type_reference *param; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(param); @@ -3182,7 +3182,7 @@ static void instantiate_reflection_method(INTERNAL_FUNCTION_PARAMETERS, bool is_ zend_object *orig_obj = NULL; zend_class_entry *ce = NULL; zend_string *class_name = NULL; - char *method_name; + const char *method_name; size_t method_name_len; if (is_constructor) { @@ -3220,8 +3220,8 @@ static void instantiate_reflection_method(INTERNAL_FUNCTION_PARAMETERS, bool is_ method_name = ZSTR_VAL(arg2_str); method_name_len = ZSTR_LEN(arg2_str); } else { - char *tmp; - char *name = ZSTR_VAL(arg1_str); + const char *tmp; + const char *name = ZSTR_VAL(arg1_str); if ((tmp = strstr(name, "::")) == NULL) { zend_argument_error(reflection_exception_ptr, 1, "must be a valid method name"); @@ -3293,8 +3293,8 @@ ZEND_METHOD(ReflectionMethod, createFromMethodName) { /* {{{ Returns a string representation */ ZEND_METHOD(ReflectionMethod, __toString) { - reflection_object *intern; - zend_function *mptr; + const reflection_object *intern; + const zend_function *mptr; smart_str str = {0}; ZEND_PARSE_PARAMETERS_NONE(); @@ -3349,7 +3349,7 @@ static void reflection_method_invoke(INTERNAL_FUNCTION_PARAMETERS, bool variadic reflection_object *intern; zend_function *mptr; uint32_t argc = 0; - zend_class_entry *obj_ce; + const zend_class_entry *obj_ce; GET_REFLECTION_OBJECT_PTR(mptr); @@ -3520,8 +3520,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, isStatic) /* {{{ Returns whether this function is defined in namespace */ ZEND_METHOD(ReflectionFunctionAbstract, inNamespace) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -3540,8 +3540,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, inNamespace) /* {{{ Returns the name of namespace where this function is defined */ ZEND_METHOD(ReflectionFunctionAbstract, getNamespaceName) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -3563,8 +3563,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getNamespaceName) /* {{{ Returns the short name of the function (without namespace part) */ ZEND_METHOD(ReflectionFunctionAbstract, getShortName) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -3585,8 +3585,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getShortName) /* {{{ Return whether the function has a return type */ ZEND_METHOD(ReflectionFunctionAbstract, hasReturnType) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -3599,8 +3599,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, hasReturnType) /* {{{ Returns the return type associated with the function */ ZEND_METHOD(ReflectionFunctionAbstract, getReturnType) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -3617,8 +3617,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getReturnType) /* {{{ Return whether the function has a tentative return type */ ZEND_METHOD(ReflectionFunctionAbstract, hasTentativeReturnType) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -3631,8 +3631,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, hasTentativeReturnType) /* {{{ Returns the tentative return type associated with the function */ ZEND_METHOD(ReflectionFunctionAbstract, getTentativeReturnType) { - reflection_object *intern; - zend_function *fptr; + const reflection_object *intern; + const zend_function *fptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -3649,8 +3649,8 @@ ZEND_METHOD(ReflectionFunctionAbstract, getTentativeReturnType) /* {{{ Returns whether this method is the constructor */ ZEND_METHOD(ReflectionMethod, isConstructor) { - reflection_object *intern; - zend_function *mptr; + const reflection_object *intern; + const zend_function *mptr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(mptr); @@ -3664,8 +3664,8 @@ ZEND_METHOD(ReflectionMethod, isConstructor) /* {{{ Returns whether this method is a destructor */ ZEND_METHOD(ReflectionMethod, isDestructor) { - reflection_object *intern; - zend_function *mptr; + const reflection_object *intern; + const zend_function *mptr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(mptr); @@ -3677,8 +3677,8 @@ ZEND_METHOD(ReflectionMethod, isDestructor) /* {{{ Returns a bitfield of the modifiers for this method */ ZEND_METHOD(ReflectionMethod, getModifiers) { - reflection_object *intern; - zend_function *mptr; + const reflection_object *intern; + const zend_function *mptr; uint32_t keep_flags = ZEND_ACC_PPP_MASK | ZEND_ACC_STATIC | ZEND_ACC_ABSTRACT | ZEND_ACC_FINAL; @@ -3692,8 +3692,8 @@ ZEND_METHOD(ReflectionMethod, getModifiers) /* {{{ Get the declaring class */ ZEND_METHOD(ReflectionMethod, getDeclaringClass) { - reflection_object *intern; - zend_function *mptr; + const reflection_object *intern; + const zend_function *mptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -3706,8 +3706,8 @@ ZEND_METHOD(ReflectionMethod, getDeclaringClass) /* {{{ Returns whether a method has a prototype or not */ ZEND_METHOD(ReflectionMethod, hasPrototype) { - reflection_object *intern; - zend_function *mptr; + const reflection_object *intern; + const zend_function *mptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -3719,8 +3719,8 @@ ZEND_METHOD(ReflectionMethod, hasPrototype) /* {{{ Get the prototype */ ZEND_METHOD(ReflectionMethod, getPrototype) { - reflection_object *intern; - zend_function *mptr; + const reflection_object *intern; + const zend_function *mptr; ZEND_PARSE_PARAMETERS_NONE(); @@ -3787,7 +3787,7 @@ ZEND_METHOD(ReflectionClassConstant, __construct) /* {{{ Returns a string representation */ ZEND_METHOD(ReflectionClassConstant, __toString) { - reflection_object *intern; + const reflection_object *intern; zend_class_constant *ref; smart_str str = {0}; @@ -3830,8 +3830,8 @@ ZEND_METHOD(ReflectionClassConstant, getName) /* Returns the type associated with the class constant */ ZEND_METHOD(ReflectionClassConstant, getType) { - reflection_object *intern; - zend_class_constant *ref; + const reflection_object *intern; + const zend_class_constant *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -3847,8 +3847,8 @@ ZEND_METHOD(ReflectionClassConstant, getType) /* Returns whether class constant has a type */ ZEND_METHOD(ReflectionClassConstant, hasType) { - reflection_object *intern; - zend_class_constant *ref; + const reflection_object *intern; + const zend_class_constant *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -3858,8 +3858,8 @@ ZEND_METHOD(ReflectionClassConstant, hasType) static void _class_constant_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) /* {{{ */ { - reflection_object *intern; - zend_class_constant *ref; + const reflection_object *intern; + const zend_class_constant *ref; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ref); @@ -3897,8 +3897,8 @@ ZEND_METHOD(ReflectionClassConstant, isFinal) /* {{{ Returns a bitfield of the modifiers for this constant */ ZEND_METHOD(ReflectionClassConstant, getModifiers) { - reflection_object *intern; - zend_class_constant *ref; + const reflection_object *intern; + const zend_class_constant *ref; uint32_t keep_flags = ZEND_ACC_FINAL | ZEND_ACC_PPP_MASK; ZEND_PARSE_PARAMETERS_NONE(); @@ -3911,7 +3911,7 @@ ZEND_METHOD(ReflectionClassConstant, getModifiers) /* {{{ Returns this constant's value */ ZEND_METHOD(ReflectionClassConstant, getValue) { - reflection_object *intern; + const reflection_object *intern; zend_class_constant *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -3939,8 +3939,8 @@ ZEND_METHOD(ReflectionClassConstant, getValue) /* {{{ Get the declaring class */ ZEND_METHOD(ReflectionClassConstant, getDeclaringClass) { - reflection_object *intern; - zend_class_constant *ref; + const reflection_object *intern; + const zend_class_constant *ref; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ref); @@ -3952,8 +3952,8 @@ ZEND_METHOD(ReflectionClassConstant, getDeclaringClass) /* {{{ Returns the doc comment for this constant */ ZEND_METHOD(ReflectionClassConstant, getDocComment) { - reflection_object *intern; - zend_class_constant *ref; + const reflection_object *intern; + const zend_class_constant *ref; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ref); @@ -3967,7 +3967,7 @@ ZEND_METHOD(ReflectionClassConstant, getDocComment) /* {{{ Returns the attributes of this constant */ ZEND_METHOD(ReflectionClassConstant, getAttributes) { - reflection_object *intern; + const reflection_object *intern; zend_class_constant *ref; GET_REFLECTION_OBJECT_PTR(ref); @@ -4078,7 +4078,7 @@ static void add_class_vars(zend_class_entry *ce, bool statics, zval *return_valu /* {{{ Returns an associative array containing all static property values of the class */ ZEND_METHOD(ReflectionClass, getStaticProperties) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -4132,7 +4132,7 @@ ZEND_METHOD(ReflectionClass, getStaticProperties) /* {{{ Returns the value of a static property */ ZEND_METHOD(ReflectionClass, getStaticPropertyValue) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_string *name; zval *def_value = NULL; @@ -4173,7 +4173,7 @@ ZEND_METHOD(ReflectionClass, getStaticPropertyValue) /* {{{ Sets the value of a static property */ ZEND_METHOD(ReflectionClass, setStaticPropertyValue) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_string *name; zval *value; @@ -4221,7 +4221,7 @@ ZEND_METHOD(ReflectionClass, setStaticPropertyValue) /* {{{ Returns an associative array containing copies of all default property values of the class */ ZEND_METHOD(ReflectionClass, getDefaultProperties) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -4252,8 +4252,8 @@ ZEND_METHOD(ReflectionClass, __toString) /* {{{ Returns the class' name */ ZEND_METHOD(ReflectionClass, getName) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -4265,8 +4265,8 @@ ZEND_METHOD(ReflectionClass, getName) /* {{{ Returns whether this class is an internal class */ ZEND_METHOD(ReflectionClass, isInternal) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -4277,8 +4277,8 @@ ZEND_METHOD(ReflectionClass, isInternal) /* {{{ Returns whether this class is user-defined */ ZEND_METHOD(ReflectionClass, isUserDefined) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -4289,8 +4289,8 @@ ZEND_METHOD(ReflectionClass, isUserDefined) /* {{{ _class_check_flag */ static void _class_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -4308,8 +4308,8 @@ ZEND_METHOD(ReflectionClass, isAnonymous) /* {{{ Returns the filename of the file this class was declared in */ ZEND_METHOD(ReflectionClass, getFileName) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -4323,8 +4323,8 @@ ZEND_METHOD(ReflectionClass, getFileName) /* {{{ Returns the line this class' declaration starts at */ ZEND_METHOD(ReflectionClass, getStartLine) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -4338,8 +4338,8 @@ ZEND_METHOD(ReflectionClass, getStartLine) /* {{{ Returns the line this class' declaration ends at */ ZEND_METHOD(ReflectionClass, getEndLine) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -4353,8 +4353,8 @@ ZEND_METHOD(ReflectionClass, getEndLine) /* {{{ Returns the doc comment for this class */ ZEND_METHOD(ReflectionClass, getDocComment) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -4368,7 +4368,7 @@ ZEND_METHOD(ReflectionClass, getDocComment) /* {{{ Returns the attributes for this class */ ZEND_METHOD(ReflectionClass, getAttributes) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; GET_REFLECTION_OBJECT_PTR(ce); @@ -4382,7 +4382,7 @@ ZEND_METHOD(ReflectionClass, getAttributes) /* {{{ Returns the class' constructor if there is one, NULL otherwise */ ZEND_METHOD(ReflectionClass, getConstructor) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -4399,8 +4399,8 @@ ZEND_METHOD(ReflectionClass, getConstructor) /* {{{ Returns whether a method exists or not */ ZEND_METHOD(ReflectionClass, hasMethod) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; zend_string *name; if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) { @@ -4417,7 +4417,7 @@ ZEND_METHOD(ReflectionClass, hasMethod) /* {{{ Returns the class' method specified by its name */ ZEND_METHOD(ReflectionClass, getMethod) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_string *name; @@ -4471,7 +4471,7 @@ static bool _addmethod(zend_function *mptr, zend_class_entry *ce, HashTable *ht, /* {{{ Returns an array of this class' methods */ ZEND_METHOD(ReflectionClass, getMethods) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_long filter; bool filter_is_null = true; @@ -4519,8 +4519,8 @@ ZEND_METHOD(ReflectionClass, getMethods) /* {{{ Returns whether a property exists or not */ ZEND_METHOD(ReflectionClass, hasProperty) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; zend_string *name; if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) { @@ -4547,7 +4547,7 @@ ZEND_METHOD(ReflectionClass, hasProperty) /* {{{ Returns the class' property specified by its name */ ZEND_METHOD(ReflectionClass, getProperty) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_string *name; @@ -4571,8 +4571,8 @@ ZEND_METHOD(ReflectionClass, getProperty) return; } } - char *str_name = ZSTR_VAL(name); - char *tmp; + const char *str_name = ZSTR_VAL(name); + const char *tmp; if ((tmp = strstr(ZSTR_VAL(name), "::")) != NULL) { size_t classname_len = tmp - ZSTR_VAL(name); zend_string *classname = zend_string_init(ZSTR_VAL(name), classname_len, false); @@ -4647,7 +4647,7 @@ static void _adddynproperty(zval *ptr, zend_string *key, zend_class_entry *ce, z /* {{{ Returns an array of this class' properties */ ZEND_METHOD(ReflectionClass, getProperties) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_long filter; bool filter_is_null = true; @@ -4680,8 +4680,8 @@ ZEND_METHOD(ReflectionClass, getProperties) /* {{{ Returns whether a constant exists or not */ ZEND_METHOD(ReflectionClass, hasConstant) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; zend_string *name; if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) { @@ -4696,8 +4696,8 @@ ZEND_METHOD(ReflectionClass, hasConstant) /* {{{ Returns an associative array containing this class' constants and their values */ ZEND_METHOD(ReflectionClass, getConstants) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; zend_long filter; bool filter_is_null = true; @@ -4734,7 +4734,7 @@ ZEND_METHOD(ReflectionClass, getConstants) /* {{{ Returns an associative array containing this class' constants as ReflectionClassConstant objects */ ZEND_METHOD(ReflectionClass, getReflectionConstants) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_long filter; bool filter_is_null = true; @@ -4768,7 +4768,7 @@ ZEND_METHOD(ReflectionClass, getReflectionConstants) /* {{{ Returns the class' constant specified by its name */ ZEND_METHOD(ReflectionClass, getConstant) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_string *name; @@ -4799,7 +4799,7 @@ ZEND_METHOD(ReflectionClass, getConstant) /* {{{ Returns the class' constant as ReflectionClassConstant objects */ ZEND_METHOD(ReflectionClass, getReflectionConstant) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_string *name; @@ -4819,8 +4819,8 @@ ZEND_METHOD(ReflectionClass, getReflectionConstant) /* {{{ Returns whether this class is instantiable */ ZEND_METHOD(ReflectionClass, isInstantiable) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -4841,7 +4841,7 @@ ZEND_METHOD(ReflectionClass, isInstantiable) /* {{{ Returns whether this class is cloneable */ ZEND_METHOD(ReflectionClass, isCloneable) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -4909,8 +4909,8 @@ ZEND_METHOD(ReflectionClass, isAbstract) /* {{{ Returns a bitfield of the modifiers for this class */ ZEND_METHOD(ReflectionClass, getModifiers) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; uint32_t keep_flags = ZEND_ACC_FINAL | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_READONLY_CLASS; ZEND_PARSE_PARAMETERS_NONE(); @@ -4923,9 +4923,9 @@ ZEND_METHOD(ReflectionClass, getModifiers) /* {{{ Returns whether the given object is an instance of this class */ ZEND_METHOD(ReflectionClass, isInstance) { - reflection_object *intern; - zend_class_entry *ce; - zval *object; + const reflection_object *intern; + const zend_class_entry *ce; + const zval *object; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &object) == FAILURE) { RETURN_THROWS(); @@ -4938,7 +4938,7 @@ ZEND_METHOD(ReflectionClass, isInstance) /* {{{ Returns an instance of this class */ ZEND_METHOD(ReflectionClass, newInstance) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; GET_REFLECTION_OBJECT_PTR(ce); @@ -4983,7 +4983,7 @@ ZEND_METHOD(ReflectionClass, newInstance) /* {{{ Returns an instance of this class without invoking its constructor */ ZEND_METHOD(ReflectionClass, newInstanceWithoutConstructor) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; GET_REFLECTION_OBJECT_PTR(ce); @@ -5003,7 +5003,7 @@ ZEND_METHOD(ReflectionClass, newInstanceWithoutConstructor) /* {{{ Returns an instance of this class */ ZEND_METHOD(ReflectionClass, newInstanceArgs) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; HashTable *args = NULL; @@ -5050,7 +5050,7 @@ ZEND_METHOD(ReflectionClass, newInstanceArgs) void reflection_class_new_lazy(INTERNAL_FUNCTION_PARAMETERS, int strategy, bool is_reset) { - reflection_object *intern; + const reflection_object *intern; zend_object *obj; zend_class_entry *ce; zend_fcall_info fci; @@ -5154,7 +5154,7 @@ PHP_METHOD(ReflectionClass, resetAsLazyProxy) /* {{{ Returns whether object lazy and uninitialized */ ZEND_METHOD(ReflectionClass, isUninitializedLazyObject) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_object *object; @@ -5171,7 +5171,7 @@ ZEND_METHOD(ReflectionClass, isUninitializedLazyObject) /* {{{ Trigger object initialization */ ZEND_METHOD(ReflectionClass, initializeLazyObject) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_object *object; @@ -5197,7 +5197,7 @@ ZEND_METHOD(ReflectionClass, initializeLazyObject) /* {{{ Mark object as initialized without calling the initializer */ ZEND_METHOD(ReflectionClass, markLazyObjectAsInitialized) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_object *object; @@ -5223,7 +5223,7 @@ ZEND_METHOD(ReflectionClass, markLazyObjectAsInitialized) /* {{{ Get lazy object initializer */ ZEND_METHOD(ReflectionClass, getLazyInitializer) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce; zend_object *object; @@ -5246,8 +5246,8 @@ ZEND_METHOD(ReflectionClass, getLazyInitializer) /* {{{ Returns an array of interfaces this class implements */ ZEND_METHOD(ReflectionClass, getInterfaces) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -5269,8 +5269,8 @@ ZEND_METHOD(ReflectionClass, getInterfaces) /* {{{ Returns an array of names of interfaces this class implements */ ZEND_METHOD(ReflectionClass, getInterfaceNames) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -5292,8 +5292,8 @@ ZEND_METHOD(ReflectionClass, getInterfaceNames) /* {{{ Returns an array of traits used by this class */ ZEND_METHOD(ReflectionClass, getTraits) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -5319,8 +5319,8 @@ ZEND_METHOD(ReflectionClass, getTraits) /* {{{ Returns an array of names of traits used by this class */ ZEND_METHOD(ReflectionClass, getTraitNames) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -5340,8 +5340,8 @@ ZEND_METHOD(ReflectionClass, getTraitNames) /* {{{ Returns an array of trait aliases */ ZEND_METHOD(ReflectionClass, getTraitAliases) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -5352,7 +5352,7 @@ ZEND_METHOD(ReflectionClass, getTraitAliases) array_init(return_value); for (uint32_t i = 0; ce->trait_aliases[i]; i++) { - zend_trait_method_reference *cur_ref = &ce->trait_aliases[i]->trait_method; + const zend_trait_method_reference *cur_ref = &ce->trait_aliases[i]->trait_method; if (!ce->trait_aliases[i]->alias) { continue; @@ -5363,7 +5363,7 @@ ZEND_METHOD(ReflectionClass, getTraitAliases) zend_string *lcname = zend_string_tolower(cur_ref->method_name); for (uint32_t j = 0; j < ce->num_traits; j++) { - zend_class_entry *trait = + const zend_class_entry *trait = zend_hash_find_ptr(CG(class_table), ce->trait_names[j].lc_name); ZEND_ASSERT(trait && "Trait must exist"); if (zend_hash_exists(&trait->function_table, lcname)) { @@ -5385,8 +5385,8 @@ ZEND_METHOD(ReflectionClass, getTraitAliases) /* {{{ Returns the class' parent class, or, if none exists, FALSE */ ZEND_METHOD(ReflectionClass, getParentClass) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ce); @@ -5402,7 +5402,7 @@ ZEND_METHOD(ReflectionClass, getParentClass) /* {{{ Returns whether this class is a subclass of another class */ ZEND_METHOD(ReflectionClass, isSubclassOf) { - reflection_object *intern; + const reflection_object *intern; zend_class_entry *ce, *class_ce; zend_string *class_str; zend_object *class_obj; @@ -5412,7 +5412,7 @@ ZEND_METHOD(ReflectionClass, isSubclassOf) ZEND_PARSE_PARAMETERS_END(); if (class_obj) { - reflection_object *argument = reflection_object_from_obj(class_obj); + const reflection_object *argument = reflection_object_from_obj(class_obj); if (argument->ptr == NULL) { zend_throw_error(NULL, "Internal error: Failed to retrieve the argument's reflection object"); RETURN_THROWS(); @@ -5435,7 +5435,7 @@ ZEND_METHOD(ReflectionClass, isSubclassOf) /* {{{ Returns whether this class is a subclass of another class */ ZEND_METHOD(ReflectionClass, implementsInterface) { - reflection_object *intern; + const reflection_object *intern; zend_string *interface_str; zend_class_entry *ce, *interface_ce; zend_object *interface_obj; @@ -5445,7 +5445,7 @@ ZEND_METHOD(ReflectionClass, implementsInterface) ZEND_PARSE_PARAMETERS_END(); if (interface_obj) { - reflection_object *argument = reflection_object_from_obj(interface_obj); + const reflection_object *argument = reflection_object_from_obj(interface_obj); if (argument->ptr == NULL) { zend_throw_error(NULL, "Internal error: Failed to retrieve the argument's reflection object"); RETURN_THROWS(); @@ -5471,8 +5471,8 @@ ZEND_METHOD(ReflectionClass, implementsInterface) /* {{{ Returns whether this class is iterable (can be used inside foreach) */ ZEND_METHOD(ReflectionClass, isIterable) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -5491,8 +5491,8 @@ ZEND_METHOD(ReflectionClass, isIterable) /* {{{ Returns NULL or the extension the class belongs to */ ZEND_METHOD(ReflectionClass, getExtension) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -5507,8 +5507,8 @@ ZEND_METHOD(ReflectionClass, getExtension) /* {{{ Returns false or the name of the extension the class belongs to */ ZEND_METHOD(ReflectionClass, getExtensionName) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -5525,8 +5525,8 @@ ZEND_METHOD(ReflectionClass, getExtensionName) /* {{{ Returns whether this class is defined in namespace */ ZEND_METHOD(ReflectionClass, inNamespace) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -5541,8 +5541,8 @@ ZEND_METHOD(ReflectionClass, inNamespace) /* {{{ Returns the name of namespace where this class is defined */ ZEND_METHOD(ReflectionClass, getNamespaceName) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -5560,8 +5560,8 @@ ZEND_METHOD(ReflectionClass, getNamespaceName) /* {{{ Returns the short name of the class (without namespace part) */ ZEND_METHOD(ReflectionClass, getShortName) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -5651,8 +5651,8 @@ ZEND_METHOD(ReflectionProperty, __construct) /* {{{ Returns a string representation */ ZEND_METHOD(ReflectionProperty, __toString) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; smart_str str = {0}; ZEND_PARSE_PARAMETERS_NONE(); @@ -5665,8 +5665,8 @@ ZEND_METHOD(ReflectionProperty, __toString) /* {{{ Returns the property's name */ ZEND_METHOD(ReflectionProperty, getName) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -5677,8 +5677,8 @@ ZEND_METHOD(ReflectionProperty, getName) ZEND_METHOD(ReflectionProperty, getMangledName) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -5692,8 +5692,8 @@ ZEND_METHOD(ReflectionProperty, getMangledName) static void _property_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) /* {{{ */ { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ref); @@ -5756,8 +5756,8 @@ ZEND_METHOD(ReflectionProperty, isVirtual) static void _property_check_dynamic(INTERNAL_FUNCTION_PARAMETERS, bool dynamic_true) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ref); @@ -5789,8 +5789,8 @@ ZEND_METHOD(ReflectionProperty, isPromoted) /* {{{ Returns a bitfield of the modifiers for this property */ ZEND_METHOD(ReflectionProperty, getModifiers) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; uint32_t keep_flags = ZEND_ACC_PPP_MASK | ZEND_ACC_PPP_SET_MASK | ZEND_ACC_STATIC | ZEND_ACC_READONLY | ZEND_ACC_ABSTRACT | ZEND_ACC_VIRTUAL | ZEND_ACC_FINAL; ZEND_PARSE_PARAMETERS_NONE(); @@ -5803,7 +5803,7 @@ ZEND_METHOD(ReflectionProperty, getModifiers) /* {{{ Returns this property's value */ ZEND_METHOD(ReflectionProperty, getValue) { - reflection_object *intern; + const reflection_object *intern; property_reference *ref; zval *object = NULL; @@ -5864,7 +5864,7 @@ ZEND_METHOD(ReflectionProperty, getValue) /* {{{ Sets this property's value */ ZEND_METHOD(ReflectionProperty, setValue) { - reflection_object *intern; + const reflection_object *intern; property_reference *ref; zval *value; @@ -5925,7 +5925,7 @@ static zend_property_info *reflection_property_get_effective_prop( ZEND_METHOD(ReflectionProperty, getRawValue) { - reflection_object *intern; + const reflection_object *intern; property_reference *ref; zval *object; @@ -6017,7 +6017,7 @@ PHPAPI void zend_reflection_property_set_raw_value(zend_property_info *prop, ZEND_METHOD(ReflectionProperty, setRawValue) { - reflection_object *intern; + const reflection_object *intern; property_reference *ref; zval *object; zval *value; @@ -6123,7 +6123,7 @@ PHPAPI void zend_reflection_property_set_raw_value_without_lazy_initialization( /* {{{ Set property value without triggering initializer while skipping hooks if any */ ZEND_METHOD(ReflectionProperty, setRawValueWithoutLazyInitialization) { - reflection_object *intern; + const reflection_object *intern; property_reference *ref; zend_object *object; zval *value; @@ -6143,7 +6143,7 @@ ZEND_METHOD(ReflectionProperty, setRawValueWithoutLazyInitialization) /* {{{ Mark property as non-lazy, and initialize to default value */ ZEND_METHOD(ReflectionProperty, skipLazyInitialization) { - reflection_object *intern; + const reflection_object *intern; property_reference *ref; zend_object *object; @@ -6187,8 +6187,8 @@ ZEND_METHOD(ReflectionProperty, skipLazyInitialization) ZEND_METHOD(ReflectionProperty, isLazy) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; zend_object *object; GET_REFLECTION_OBJECT_PTR(ref); @@ -6212,7 +6212,7 @@ ZEND_METHOD(ReflectionProperty, isLazy) /* {{{ Returns true if property was initialized */ ZEND_METHOD(ReflectionProperty, isInitialized) { - reflection_object *intern; + const reflection_object *intern; property_reference *ref; zval *object = NULL; @@ -6263,8 +6263,8 @@ ZEND_METHOD(ReflectionProperty, isInitialized) /* {{{ Get the declaring class */ ZEND_METHOD(ReflectionProperty, getDeclaringClass) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ref); @@ -6277,8 +6277,8 @@ ZEND_METHOD(ReflectionProperty, getDeclaringClass) /* {{{ Returns the doc comment for this property */ ZEND_METHOD(ReflectionProperty, getDocComment) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ref); @@ -6292,8 +6292,8 @@ ZEND_METHOD(ReflectionProperty, getDocComment) /* {{{ Returns the attributes of this property */ ZEND_METHOD(ReflectionProperty, getAttributes) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; GET_REFLECTION_OBJECT_PTR(ref); @@ -6321,8 +6321,8 @@ ZEND_METHOD(ReflectionProperty, setAccessible) /* {{{ Returns the type associated with the property */ ZEND_METHOD(ReflectionProperty, getType) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -6338,8 +6338,8 @@ ZEND_METHOD(ReflectionProperty, getType) ZEND_METHOD(ReflectionProperty, getSettableType) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -6378,8 +6378,8 @@ ZEND_METHOD(ReflectionProperty, getSettableType) /* {{{ Returns whether property has a type */ ZEND_METHOD(ReflectionProperty, hasType) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -6392,8 +6392,8 @@ ZEND_METHOD(ReflectionProperty, hasType) /* {{{ Returns whether property has a default value */ ZEND_METHOD(ReflectionProperty, hasDefaultValue) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -6413,8 +6413,8 @@ ZEND_METHOD(ReflectionProperty, hasDefaultValue) /* {{{ Returns the default value of a property */ ZEND_METHOD(ReflectionProperty, getDefaultValue) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -6458,8 +6458,8 @@ ZEND_METHOD(ReflectionProperty, getDefaultValue) ZEND_METHOD(ReflectionProperty, hasHooks) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -6470,8 +6470,8 @@ ZEND_METHOD(ReflectionProperty, hasHooks) ZEND_METHOD(ReflectionProperty, getHooks) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -6500,8 +6500,8 @@ ZEND_METHOD(ReflectionProperty, getHooks) ZEND_METHOD(ReflectionProperty, hasHook) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; zend_enum_PropertyHookType type; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -6522,8 +6522,8 @@ ZEND_METHOD(ReflectionProperty, hasHook) ZEND_METHOD(ReflectionProperty, getHook) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; zend_enum_PropertyHookType type; ZEND_PARSE_PARAMETERS_START(1, 1) @@ -6584,7 +6584,7 @@ static zend_always_inline uint32_t set_visibility_to_visibility(uint32_t set_vis } } -static bool check_visibility(uint32_t visibility, const zend_class_entry *ce, zend_class_entry *scope) +static bool check_visibility(uint32_t visibility, const zend_class_entry *ce, const zend_class_entry *scope) { if (!(visibility & ZEND_ACC_PUBLIC) && (scope != ce)) { if (!scope) { @@ -6603,8 +6603,8 @@ static bool check_visibility(uint32_t visibility, const zend_class_entry *ce, ze ZEND_METHOD(ReflectionProperty, isReadable) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; zend_string *scope_name; zend_object *obj = NULL; @@ -6715,8 +6715,8 @@ retry_declared:; ZEND_METHOD(ReflectionProperty, isWritable) { - reflection_object *intern; - property_reference *ref; + const reflection_object *intern; + const property_reference *ref; zend_string *scope_name; zend_object *obj = NULL; @@ -6829,8 +6829,8 @@ ZEND_METHOD(ReflectionExtension, __construct) /* {{{ Returns a string representation */ ZEND_METHOD(ReflectionExtension, __toString) { - reflection_object *intern; - zend_module_entry *module; + const reflection_object *intern; + const zend_module_entry *module; smart_str str = {0}; ZEND_PARSE_PARAMETERS_NONE(); @@ -6843,8 +6843,8 @@ ZEND_METHOD(ReflectionExtension, __toString) /* {{{ Returns this extension's name */ ZEND_METHOD(ReflectionExtension, getName) { - reflection_object *intern; - zend_module_entry *module; + const reflection_object *intern; + const zend_module_entry *module; ZEND_PARSE_PARAMETERS_NONE(); @@ -6856,8 +6856,8 @@ ZEND_METHOD(ReflectionExtension, getName) /* {{{ Returns this extension's version */ ZEND_METHOD(ReflectionExtension, getVersion) { - reflection_object *intern; - zend_module_entry *module; + const reflection_object *intern; + const zend_module_entry *module; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(module); @@ -6874,8 +6874,8 @@ ZEND_METHOD(ReflectionExtension, getVersion) /* {{{ Returns an array of this extension's functions */ ZEND_METHOD(ReflectionExtension, getFunctions) { - reflection_object *intern; - zend_module_entry *module; + const reflection_object *intern; + const zend_module_entry *module; zval function; ZEND_PARSE_PARAMETERS_NONE(); @@ -6896,8 +6896,8 @@ ZEND_METHOD(ReflectionExtension, getFunctions) /* {{{ Returns an associative array containing this extension's constants and their values */ ZEND_METHOD(ReflectionExtension, getConstants) { - reflection_object *intern; - zend_module_entry *module; + const reflection_object *intern; + const zend_module_entry *module; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(module); @@ -6931,8 +6931,8 @@ static void _addinientry(const zend_ini_entry *ini_entry, const zval *retval, in /* {{{ Returns an associative array containing this extension's INI entries and their values */ ZEND_METHOD(ReflectionExtension, getINIEntries) { - reflection_object *intern; - zend_module_entry *module; + const reflection_object *intern; + const zend_module_entry *module; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(module); @@ -6971,8 +6971,8 @@ static void add_extension_class(zend_class_entry *ce, zend_string *key, zval *cl /* {{{ Returns an array containing ReflectionClass objects for all classes of this extension */ ZEND_METHOD(ReflectionExtension, getClasses) { - reflection_object *intern; - zend_module_entry *module; + const reflection_object *intern; + const zend_module_entry *module; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(module); @@ -6987,8 +6987,8 @@ ZEND_METHOD(ReflectionExtension, getClasses) /* {{{ Returns an array containing all names of all classes of this extension */ ZEND_METHOD(ReflectionExtension, getClassNames) { - reflection_object *intern; - zend_module_entry *module; + const reflection_object *intern; + const zend_module_entry *module; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(module); @@ -7003,8 +7003,8 @@ ZEND_METHOD(ReflectionExtension, getClassNames) /* {{{ Returns an array containing all names of all extensions this extension depends on */ ZEND_METHOD(ReflectionExtension, getDependencies) { - reflection_object *intern; - zend_module_entry *module; + const reflection_object *intern; + const zend_module_entry *module; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(module); @@ -7017,7 +7017,7 @@ ZEND_METHOD(ReflectionExtension, getDependencies) array_init(return_value); while (dep->name) { - char *rel_type; + const char *rel_type; size_t len = 0; switch(dep->type) { @@ -7063,7 +7063,7 @@ ZEND_METHOD(ReflectionExtension, getDependencies) /* {{{ Prints phpinfo block for the extension */ ZEND_METHOD(ReflectionExtension, info) { - reflection_object *intern; + const reflection_object *intern; zend_module_entry *module; ZEND_PARSE_PARAMETERS_NONE(); @@ -7076,8 +7076,8 @@ ZEND_METHOD(ReflectionExtension, info) /* {{{ Returns whether this extension is persistent */ ZEND_METHOD(ReflectionExtension, isPersistent) { - reflection_object *intern; - zend_module_entry *module; + const reflection_object *intern; + const zend_module_entry *module; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(module); @@ -7089,8 +7089,8 @@ ZEND_METHOD(ReflectionExtension, isPersistent) /* {{{ Returns whether this extension is temporary */ ZEND_METHOD(ReflectionExtension, isTemporary) { - reflection_object *intern; - zend_module_entry *module; + const reflection_object *intern; + const zend_module_entry *module; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(module); @@ -7102,7 +7102,7 @@ ZEND_METHOD(ReflectionExtension, isTemporary) /* {{{ Constructor. Throws an Exception in case the given Zend extension does not exist */ ZEND_METHOD(ReflectionZendExtension, __construct) { - char *name_str; + const char *name_str; size_t name_len; if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &name_str, &name_len) == FAILURE) { @@ -7128,8 +7128,8 @@ ZEND_METHOD(ReflectionZendExtension, __construct) /* {{{ Returns a string representation */ ZEND_METHOD(ReflectionZendExtension, __toString) { - reflection_object *intern; - zend_extension *extension; + const reflection_object *intern; + const zend_extension *extension; smart_str str = {0}; ZEND_PARSE_PARAMETERS_NONE(); @@ -7142,8 +7142,8 @@ ZEND_METHOD(ReflectionZendExtension, __toString) /* {{{ Returns the name of this Zend extension */ ZEND_METHOD(ReflectionZendExtension, getName) { - reflection_object *intern; - zend_extension *extension; + const reflection_object *intern; + const zend_extension *extension; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(extension); @@ -7155,8 +7155,8 @@ ZEND_METHOD(ReflectionZendExtension, getName) /* {{{ Returns the version information of this Zend extension */ ZEND_METHOD(ReflectionZendExtension, getVersion) { - reflection_object *intern; - zend_extension *extension; + const reflection_object *intern; + const zend_extension *extension; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(extension); @@ -7172,8 +7172,8 @@ ZEND_METHOD(ReflectionZendExtension, getVersion) /* {{{ Returns the name of this Zend extension's author */ ZEND_METHOD(ReflectionZendExtension, getAuthor) { - reflection_object *intern; - zend_extension *extension; + const reflection_object *intern; + const zend_extension *extension; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(extension); @@ -7189,8 +7189,8 @@ ZEND_METHOD(ReflectionZendExtension, getAuthor) /* {{{ Returns this Zend extension's URL*/ ZEND_METHOD(ReflectionZendExtension, getURL) { - reflection_object *intern; - zend_extension *extension; + const reflection_object *intern; + const zend_extension *extension; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(extension); @@ -7206,8 +7206,8 @@ ZEND_METHOD(ReflectionZendExtension, getURL) /* {{{ Returns this Zend extension's copyright information */ ZEND_METHOD(ReflectionZendExtension, getCopyright) { - reflection_object *intern; - zend_extension *extension; + const reflection_object *intern; + const zend_extension *extension; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(extension); @@ -7320,8 +7320,8 @@ ZEND_METHOD(ReflectionAttribute, __clone) /* {{{ Returns a string representation */ ZEND_METHOD(ReflectionAttribute, __toString) { - reflection_object *intern; - attribute_reference *attr; + const reflection_object *intern; + const attribute_reference *attr; ZEND_PARSE_PARAMETERS_NONE(); @@ -7361,8 +7361,8 @@ ZEND_METHOD(ReflectionAttribute, __toString) /* {{{ Returns the name of the attribute */ ZEND_METHOD(ReflectionAttribute, getName) { - reflection_object *intern; - attribute_reference *attr; + const reflection_object *intern; + const attribute_reference *attr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(attr); @@ -7374,8 +7374,8 @@ ZEND_METHOD(ReflectionAttribute, getName) /* {{{ Returns the target of the attribute */ ZEND_METHOD(ReflectionAttribute, getTarget) { - reflection_object *intern; - attribute_reference *attr; + const reflection_object *intern; + const attribute_reference *attr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(attr); @@ -7387,8 +7387,8 @@ ZEND_METHOD(ReflectionAttribute, getTarget) /* {{{ Returns true if the attribute is repeated */ ZEND_METHOD(ReflectionAttribute, isRepeated) { - reflection_object *intern; - attribute_reference *attr; + const reflection_object *intern; + const attribute_reference *attr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(attr); @@ -7400,8 +7400,8 @@ ZEND_METHOD(ReflectionAttribute, isRepeated) /* {{{ Returns the arguments passed to the attribute */ ZEND_METHOD(ReflectionAttribute, getArguments) { - reflection_object *intern; - attribute_reference *attr; + const reflection_object *intern; + const attribute_reference *attr; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(attr); @@ -7431,8 +7431,8 @@ ZEND_METHOD(ReflectionAttribute, getArguments) /* {{{ Returns the attribute as an object */ ZEND_METHOD(ReflectionAttribute, newInstance) { - reflection_object *intern; - attribute_reference *attr; + const reflection_object *intern; + const attribute_reference *attr; ZEND_PARSE_PARAMETERS_NONE(); @@ -7491,7 +7491,7 @@ ZEND_METHOD(ReflectionAttribute, newInstance) * more expensive than just an assertion and so we don't worry about it * for non-debug builds. See discussion on GH-18817. */ #if ZEND_DEBUG - zend_attribute *delayed_target_validation = zend_get_attribute_str( + const zend_attribute *delayed_target_validation = zend_get_attribute_str( attr->attributes, "delayedtargetvalidation", strlen("delayedtargetvalidation") @@ -7528,8 +7528,8 @@ ZEND_METHOD(ReflectionEnum, __construct) RETURN_THROWS(); } - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; GET_REFLECTION_OBJECT_PTR(ce); if (!(ce->ce_flags & ZEND_ACC_ENUM)) { @@ -7540,8 +7540,8 @@ ZEND_METHOD(ReflectionEnum, __construct) ZEND_METHOD(ReflectionEnum, hasCase) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; zend_string *name; if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) { @@ -7560,8 +7560,8 @@ ZEND_METHOD(ReflectionEnum, hasCase) ZEND_METHOD(ReflectionEnum, getCase) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; zend_string *name; if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name) == FAILURE) { @@ -7585,8 +7585,8 @@ ZEND_METHOD(ReflectionEnum, getCase) ZEND_METHOD(ReflectionEnum, getCases) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -7604,8 +7604,8 @@ ZEND_METHOD(ReflectionEnum, getCases) ZEND_METHOD(ReflectionEnum, isBacked) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -7615,8 +7615,8 @@ ZEND_METHOD(ReflectionEnum, isBacked) ZEND_METHOD(ReflectionEnum, getBackingType) { - reflection_object *intern; - zend_class_entry *ce; + const reflection_object *intern; + const zend_class_entry *ce; ZEND_PARSE_PARAMETERS_NONE(); @@ -7637,8 +7637,8 @@ ZEND_METHOD(ReflectionEnumUnitCase, __construct) RETURN_THROWS(); } - reflection_object *intern; - zend_class_constant *ref; + const reflection_object *intern; + const zend_class_constant *ref; GET_REFLECTION_OBJECT_PTR(ref); @@ -7651,8 +7651,8 @@ ZEND_METHOD(ReflectionEnumUnitCase, __construct) ZEND_METHOD(ReflectionEnumUnitCase, getEnum) { - reflection_object *intern; - zend_class_constant *ref; + const reflection_object *intern; + const zend_class_constant *ref; ZEND_PARSE_PARAMETERS_NONE(); GET_REFLECTION_OBJECT_PTR(ref); @@ -7667,8 +7667,8 @@ ZEND_METHOD(ReflectionEnumBackedCase, __construct) RETURN_THROWS(); } - reflection_object *intern; - zend_class_constant *ref; + const reflection_object *intern; + const zend_class_constant *ref; GET_REFLECTION_OBJECT_PTR(ref); @@ -7681,7 +7681,7 @@ ZEND_METHOD(ReflectionEnumBackedCase, __construct) ZEND_METHOD(ReflectionEnumBackedCase, getBackingValue) { - reflection_object *intern; + const reflection_object *intern; zend_class_constant *ref; ZEND_PARSE_PARAMETERS_NONE(); @@ -7852,7 +7852,7 @@ ZEND_METHOD(ReflectionConstant, __construct) /* Build name with lowercased ns. */ bool backslash_prefixed = ZSTR_VAL(name)[0] == '\\'; - char *source = ZSTR_VAL(name) + backslash_prefixed; + const char *source = ZSTR_VAL(name) + backslash_prefixed; size_t source_len = ZSTR_LEN(name) - backslash_prefixed; zend_string *lc_name = zend_string_alloc(source_len, /* persistent */ false); const char *ns_end = zend_memrchr(source, '\\', source_len); @@ -7880,8 +7880,8 @@ ZEND_METHOD(ReflectionConstant, __construct) ZEND_METHOD(ReflectionConstant, getName) { - reflection_object *intern; - zend_constant *const_; + const reflection_object *intern; + const zend_constant *const_; ZEND_PARSE_PARAMETERS_NONE(); @@ -7891,8 +7891,8 @@ ZEND_METHOD(ReflectionConstant, getName) ZEND_METHOD(ReflectionConstant, inNamespace) { - reflection_object *intern; - zend_constant *const_; + const reflection_object *intern; + const zend_constant *const_; ZEND_PARSE_PARAMETERS_NONE(); @@ -7905,8 +7905,8 @@ ZEND_METHOD(ReflectionConstant, inNamespace) ZEND_METHOD(ReflectionConstant, getNamespaceName) { - reflection_object *intern; - zend_constant *const_; + const reflection_object *intern; + const zend_constant *const_; ZEND_PARSE_PARAMETERS_NONE(); @@ -7923,8 +7923,8 @@ ZEND_METHOD(ReflectionConstant, getNamespaceName) ZEND_METHOD(ReflectionConstant, getShortName) { - reflection_object *intern; - zend_constant *const_; + const reflection_object *intern; + const zend_constant *const_; ZEND_PARSE_PARAMETERS_NONE(); @@ -7942,8 +7942,8 @@ ZEND_METHOD(ReflectionConstant, getShortName) ZEND_METHOD(ReflectionConstant, getValue) { - reflection_object *intern; - zend_constant *const_; + const reflection_object *intern; + const zend_constant *const_; ZEND_PARSE_PARAMETERS_NONE(); @@ -7953,8 +7953,8 @@ ZEND_METHOD(ReflectionConstant, getValue) ZEND_METHOD(ReflectionConstant, isDeprecated) { - reflection_object *intern; - zend_constant *const_; + const reflection_object *intern; + const zend_constant *const_; ZEND_PARSE_PARAMETERS_NONE(); @@ -7964,8 +7964,8 @@ ZEND_METHOD(ReflectionConstant, isDeprecated) ZEND_METHOD(ReflectionConstant, getFileName) { - reflection_object *intern; - zend_constant *const_; + const reflection_object *intern; + const zend_constant *const_; ZEND_PARSE_PARAMETERS_NONE(); @@ -7978,8 +7978,8 @@ ZEND_METHOD(ReflectionConstant, getFileName) static void reflection_constant_find_ext(INTERNAL_FUNCTION_PARAMETERS, bool only_name) { - reflection_object *intern; - zend_constant *const_; + const reflection_object *intern; + const zend_constant *const_; ZEND_PARSE_PARAMETERS_NONE(); @@ -8030,8 +8030,8 @@ ZEND_METHOD(ReflectionConstant, getExtensionName) ZEND_METHOD(ReflectionConstant, getAttributes) { - reflection_object *intern; - zend_constant *const_; + const reflection_object *intern; + const zend_constant *const_; GET_REFLECTION_OBJECT_PTR(const_); @@ -8042,8 +8042,8 @@ ZEND_METHOD(ReflectionConstant, getAttributes) ZEND_METHOD(ReflectionConstant, __toString) { - reflection_object *intern; - zend_constant *const_; + const reflection_object *intern; + const zend_constant *const_; smart_str str = {0}; ZEND_PARSE_PARAMETERS_NONE(); From b8dc2a804c6711389e832f424dae8411a2e83eff Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Fri, 17 Jul 2026 14:32:37 -0700 Subject: [PATCH 09/15] Reflection: replace `struct _zend_arg_info` with `zend_arg_info` --- ext/reflection/php_reflection.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 072c8f4c3e2b..fb45b2502468 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -747,7 +747,7 @@ static void format_default_value(smart_str *str, const zval *value) { } /* {{{ _parameter_string */ -static void _parameter_string(smart_str *str, const zend_function *fptr, const struct _zend_arg_info *arg_info, uint32_t offset, bool required) +static void _parameter_string(smart_str *str, const zend_function *fptr, const zend_arg_info *arg_info, uint32_t offset, bool required) { smart_str_append_printf(str, "Parameter #%" PRIu32 " [ ", offset); if (!required) { @@ -794,7 +794,7 @@ static void _parameter_string(smart_str *str, const zend_function *fptr, const s /* {{{ _function_parameter_string */ static void _function_parameter_string(smart_str *str, const zend_function *fptr, const char* indent) { - const struct _zend_arg_info *arg_info = fptr->common.arg_info; + const zend_arg_info *arg_info = fptr->common.arg_info; if (!arg_info) { return; } @@ -1416,7 +1416,7 @@ static void reflection_extension_factory(zval *object, zend_module_entry *module /* }}} */ /* {{{ reflection_parameter_factory */ -static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, const struct _zend_arg_info *arg_info, uint32_t offset, bool required, zval *object) +static void reflection_parameter_factory(zend_function *fptr, zval *closure_object, const zend_arg_info *arg_info, uint32_t offset, bool required, zval *object) { object_init_ex(object, reflection_parameter_ptr); reflection_object *intern = Z_REFLECTION_P(object); @@ -2177,7 +2177,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getParameters) GET_REFLECTION_OBJECT_PTR(fptr); - const struct _zend_arg_info *arg_info = fptr->common.arg_info; + const zend_arg_info *arg_info = fptr->common.arg_info; uint32_t num_args = fptr->common.num_args; if (fptr->common.fn_flags & ZEND_ACC_VARIADIC) { num_args++; @@ -2524,7 +2524,7 @@ ZEND_METHOD(ReflectionParameter, __construct) } /* Now, search for the parameter */ - const struct _zend_arg_info *arg_info = fptr->common.arg_info; + const zend_arg_info *arg_info = fptr->common.arg_info; uint32_t num_args = fptr->common.num_args; if (fptr->common.fn_flags & ZEND_ACC_VARIADIC) { num_args++; From c06e86d9cad7749e5800f7126c41858b9586e060 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Fri, 17 Jul 2026 14:34:36 -0700 Subject: [PATCH 10/15] Reflection: consistent pointer type declaration spacing Put the `*` next to the name, rather than the type --- ext/reflection/php_reflection.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index fb45b2502468..fd0d143d3b5c 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -292,10 +292,10 @@ static zend_object *reflection_objects_new(zend_class_entry *class_type) /* {{{ /* }}} */ static void _const_string(smart_str *str, const zend_string *name, const zval *value, const char *indent); -static void _function_string(smart_str *str, const zend_function *fptr, const zend_class_entry *scope, const char* indent); -static void _property_string(smart_str *str, const zend_property_info *prop, const zend_string *prop_name, const char* indent); -static void _class_const_string(smart_str *str, const zend_string *name, zend_class_constant *c, const char* indent); -static void _enum_case_string(smart_str *str, const zend_string *name, zend_class_constant *c, const char* indent); +static void _function_string(smart_str *str, const zend_function *fptr, const zend_class_entry *scope, const char *indent); +static void _property_string(smart_str *str, const zend_property_info *prop, const zend_string *prop_name, const char *indent); +static void _class_const_string(smart_str *str, const zend_string *name, zend_class_constant *c, const char *indent); +static void _enum_case_string(smart_str *str, const zend_string *name, zend_class_constant *c, const char *indent); static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const char *indent); static void _extension_string(smart_str *str, const zend_module_entry *module); static void _zend_extension_string(smart_str *str, const zend_extension *extension); @@ -792,7 +792,7 @@ static void _parameter_string(smart_str *str, const zend_function *fptr, const z /* }}} */ /* {{{ _function_parameter_string */ -static void _function_parameter_string(smart_str *str, const zend_function *fptr, const char* indent) +static void _function_parameter_string(smart_str *str, const zend_function *fptr, const char *indent) { const zend_arg_info *arg_info = fptr->common.arg_info; if (!arg_info) { @@ -818,7 +818,7 @@ static void _function_parameter_string(smart_str *str, const zend_function *fptr /* }}} */ /* {{{ _function_closure_string */ -static void _function_closure_string(smart_str *str, const zend_function *fptr, const char* indent) +static void _function_closure_string(smart_str *str, const zend_function *fptr, const char *indent) { if (fptr->type != ZEND_USER_FUNCTION || !fptr->op_array.static_variables) { return; @@ -842,7 +842,7 @@ static void _function_closure_string(smart_str *str, const zend_function *fptr, /* }}} */ /* {{{ _function_string */ -static void _function_string(smart_str *str, const zend_function *fptr, const zend_class_entry *scope, const char* indent) +static void _function_string(smart_str *str, const zend_function *fptr, const zend_class_entry *scope, const char *indent) { /* TBD: Repair indenting of doc comment (or is this to be done in the parser?) * What's "wrong" is that any whitespace before the doc comment start is @@ -969,7 +969,7 @@ static zval *property_get_default(const zend_property_info *prop_info) { } /* {{{ _property_string */ -static void _property_string(smart_str *str, const zend_property_info *prop, const zend_string *prop_name, const char* indent) +static void _property_string(smart_str *str, const zend_property_info *prop, const zend_string *prop_name, const char *indent) { if (!prop) { // Dynamic property, known to have no doc comment, flags, etc. @@ -1142,7 +1142,7 @@ static void _extension_string(smart_str *str, const zend_module_entry *module) / (module->version == NO_VERSION_YET) ? "" : module->version); if (module->deps) { - const zend_module_dep* dep = module->deps; + const zend_module_dep *dep = module->deps; smart_str_appends(str, "\n - Dependencies {\n"); From 79144103ad7dab2715dc99d75d0e937d02761666 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Fri, 17 Jul 2026 14:36:01 -0700 Subject: [PATCH 11/15] Reflection: remove unused parameter from `get_ce_from_scope_name()` --- ext/reflection/php_reflection.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index fd0d143d3b5c..60d4f415ea50 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -6556,7 +6556,7 @@ ZEND_METHOD(ReflectionProperty, isFinal) _property_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_FINAL); } -static zend_result get_ce_from_scope_name(zend_class_entry **scope, zend_string *scope_name, zend_execute_data *execute_data) +static zend_result get_ce_from_scope_name(zend_class_entry **scope, zend_string *scope_name) { if (!scope_name) { *scope = NULL; @@ -6670,7 +6670,7 @@ ZEND_METHOD(ReflectionProperty, isReadable) } zend_class_entry *scope; - if (get_ce_from_scope_name(&scope, scope_name, execute_data) == FAILURE) { + if (get_ce_from_scope_name(&scope, scope_name) == FAILURE) { RETURN_THROWS(); } @@ -6756,7 +6756,7 @@ ZEND_METHOD(ReflectionProperty, isWritable) } zend_class_entry *scope; - if (get_ce_from_scope_name(&scope, scope_name, execute_data) == FAILURE) { + if (get_ce_from_scope_name(&scope, scope_name) == FAILURE) { RETURN_THROWS(); } From b043ea357907b923418383d3d12d7d2a9cd65dc9 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Fri, 17 Jul 2026 14:36:33 -0700 Subject: [PATCH 12/15] Reflection: whitespace cleanup Avoid tabs or multiple spaces other than for indentation, remove a leading newline from `ReflectionProperty::hasHook()` --- ext/reflection/php_reflection.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 60d4f415ea50..a068f9f48ac6 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -176,7 +176,7 @@ typedef struct { #define reflection_object_from_obj(obj) ZEND_CONTAINER_OF(obj, reflection_object, zo) -#define Z_REFLECTION_P(zv) reflection_object_from_obj(Z_OBJ_P((zv))) +#define Z_REFLECTION_P(zv) reflection_object_from_obj(Z_OBJ_P((zv))) /* }}} */ static zend_object_handlers reflection_object_handlers; @@ -493,7 +493,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, const smart_str_append_printf(str, "%s }\n", indent); if (obj && Z_TYPE_P(obj) == IS_OBJECT) { - HashTable *properties = zend_get_properties_no_lazy_init(Z_OBJ_P(obj)); + HashTable *properties = zend_get_properties_no_lazy_init(Z_OBJ_P(obj)); smart_str prop_str = {0}; count = 0; @@ -1861,7 +1861,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getClosureUsedVariables) opline++; } - for (; opline->opcode == ZEND_BIND_STATIC; opline++) { + for (; opline->opcode == ZEND_BIND_STATIC; opline++) { if (!(opline->extended_value & (ZEND_BIND_IMPLICIT|ZEND_BIND_EXPLICIT))) { continue; } @@ -3317,7 +3317,7 @@ ZEND_METHOD(ReflectionMethod, getClosure) GET_REFLECTION_OBJECT_PTR(mptr); - if (mptr->common.fn_flags & ZEND_ACC_STATIC) { + if (mptr->common.fn_flags & ZEND_ACC_STATIC) { zend_create_fake_closure(return_value, mptr, mptr->common.scope, mptr->common.scope, NULL); return; } @@ -4190,7 +4190,7 @@ ZEND_METHOD(ReflectionClass, setStaticPropertyValue) const zend_class_entry *old_scope = EG(fake_scope); EG(fake_scope) = ce; zend_property_info *prop_info; - zval *variable_ptr = zend_std_get_static_property_with_info(ce, name, BP_VAR_W, &prop_info); + zval *variable_ptr = zend_std_get_static_property_with_info(ce, name, BP_VAR_W, &prop_info); EG(fake_scope) = old_scope; if (!variable_ptr) { zend_clear_exception(); @@ -4615,7 +4615,7 @@ static void _addproperty(zend_property_info *pptr, zend_string *key, zend_class_ return; } - if (pptr->flags & filter) { + if (pptr->flags & filter) { zval property; reflection_property_factory(ce, key, pptr, &property); zend_hash_next_index_insert_new(ht, &property); @@ -6499,7 +6499,6 @@ ZEND_METHOD(ReflectionProperty, getHooks) ZEND_METHOD(ReflectionProperty, hasHook) { - const reflection_object *intern; const property_reference *ref; zend_enum_PropertyHookType type; From 6210d5cf26091e2cdb91b4141b176dd2e5371114 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 19 Jul 2026 17:52:35 +0100 Subject: [PATCH 13/15] Voidify zend_std_unset_static_property() (#22809) --- Zend/zend_object_handlers.c | 3 +-- Zend/zend_object_handlers.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 9e993627a74a..7ccd9f26190a 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -2178,10 +2178,9 @@ ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *p return zend_std_get_static_property_with_info(ce, property_name, type, &prop_info); } -ZEND_API ZEND_COLD bool zend_std_unset_static_property(const zend_class_entry *ce, const zend_string *property_name) /* {{{ */ +ZEND_API ZEND_COLD void zend_std_unset_static_property(const zend_class_entry *ce, const zend_string *property_name) /* {{{ */ { zend_throw_error(NULL, "Attempt to unset static property %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(property_name)); - return 0; } /* }}} */ diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 8ed4803c3f0e..d41ae01bf700 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -249,7 +249,7 @@ ZEND_API void zend_class_init_statics(zend_class_entry *ce); ZEND_API zend_function *zend_std_get_static_method(const zend_class_entry *ce, zend_string *function_name_strval, const zval *key); ZEND_API zval *zend_std_get_static_property_with_info(zend_class_entry *ce, zend_string *property_name, int type, struct _zend_property_info **prop_info); ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *property_name, int type); -ZEND_API ZEND_COLD bool zend_std_unset_static_property(const zend_class_entry *ce, const zend_string *property_name); +ZEND_API ZEND_COLD void zend_std_unset_static_property(const zend_class_entry *ce, const zend_string *property_name); ZEND_API zend_function *zend_std_get_constructor(zend_object *object); ZEND_API struct _zend_property_info *zend_get_property_info(const zend_class_entry *ce, zend_string *member, int silent); ZEND_API HashTable *zend_std_get_properties(zend_object *object); From 8d9ed39b81365120b3b4da1739a81e2bdaeabbb6 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 19 Jul 2026 18:11:34 +0100 Subject: [PATCH 14/15] stream: registering cannot fail, thus voidify function (#22811) Propagate changes up which means we can also voidify php_init_stream_wrappers() removing an if() check during startup. --- main/main.c | 5 +---- main/php_streams.h | 2 +- main/streams/php_stream_transport.h | 4 ++-- main/streams/streams.c | 14 +++++--------- main/streams/transports.c | 11 +++++------ 5 files changed, 14 insertions(+), 22 deletions(-) diff --git a/main/main.c b/main/main.c index aba833b43b90..4348ec410920 100644 --- a/main/main.c +++ b/main/main.c @@ -2311,10 +2311,7 @@ zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additi /* initialize stream wrappers registry * (this uses configuration parameters from php.ini) */ - if (php_init_stream_wrappers(module_number) == FAILURE) { - fprintf(stderr, "PHP: Unable to initialize stream url wrappers.\n"); - return FAILURE; - } + php_init_stream_wrappers(module_number); zuv.html_errors = 1; php_startup_auto_globals(); diff --git a/main/php_streams.h b/main/php_streams.h index be8009dba91e..0dd27b8ee88a 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -629,7 +629,7 @@ END_EXTERN_C() /* this flag is only used by include/require functions */ #define STREAM_OPEN_FOR_ZEND_STREAM 0x00010000 -zend_result php_init_stream_wrappers(int module_number); +void php_init_stream_wrappers(int module_number); void php_shutdown_stream_wrappers(int module_number); void php_shutdown_stream_hashes(void); PHP_RSHUTDOWN_FUNCTION(streams); diff --git a/main/streams/php_stream_transport.h b/main/streams/php_stream_transport.h index 60bea8e9e1fc..1ee6a840cfd1 100644 --- a/main/streams/php_stream_transport.h +++ b/main/streams/php_stream_transport.h @@ -29,8 +29,8 @@ typedef php_stream *(php_stream_transport_factory_func)(const char *proto, size_ typedef php_stream_transport_factory_func *php_stream_transport_factory; BEGIN_EXTERN_C() -PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory); -PHPAPI int php_stream_xport_unregister(const char *protocol); +PHPAPI void php_stream_xport_register(const char *protocol, php_stream_transport_factory factory); +PHPAPI zend_result php_stream_xport_unregister(const char *protocol); #define STREAM_XPORT_CLIENT 0 #define STREAM_XPORT_SERVER 1 diff --git a/main/streams/streams.c b/main/streams/streams.c index 5c1041ea3a92..3d8830d7291f 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1739,7 +1739,7 @@ void php_shutdown_stream_hashes(void) php_stream_error_state_cleanup(); } -zend_result php_init_stream_wrappers(int module_number) +void php_init_stream_wrappers(int module_number) { le_stream = zend_register_list_destructors_ex(stream_resource_regular_dtor, NULL, "stream", module_number); le_pstream = zend_register_list_destructors_ex(NULL, stream_resource_persistent_dtor, "persistent stream", module_number); @@ -1751,16 +1751,12 @@ zend_result php_init_stream_wrappers(int module_number) zend_hash_init(php_get_stream_filters_hash_global(), 8, NULL, NULL, 1); zend_hash_init(php_stream_xport_get_hash(), 8, NULL, NULL, 1); - return (php_stream_xport_register("tcp", php_stream_generic_socket_factory) == SUCCESS - && - php_stream_xport_register("udp", php_stream_generic_socket_factory) == SUCCESS + php_stream_xport_register("tcp", php_stream_generic_socket_factory); + php_stream_xport_register("udp", php_stream_generic_socket_factory); #if defined(AF_UNIX) && !(defined(PHP_WIN32) || defined(__riscos__)) - && - php_stream_xport_register("unix", php_stream_generic_socket_factory) == SUCCESS - && - php_stream_xport_register("udg", php_stream_generic_socket_factory) == SUCCESS + php_stream_xport_register("unix", php_stream_generic_socket_factory); + php_stream_xport_register("udg", php_stream_generic_socket_factory); #endif - ) ? SUCCESS : FAILURE; } void php_shutdown_stream_wrappers(int module_number) diff --git a/main/streams/transports.c b/main/streams/transports.c index e171b545b11b..ca0ab7a3d310 100644 --- a/main/streams/transports.c +++ b/main/streams/transports.c @@ -14,7 +14,7 @@ #include "php.h" #include "php_streams_int.h" -#include "ext/standard/file.h" +#include "ext/standard/file.h" /* For FG(default_socket_timeout) */ static HashTable xport_hash; @@ -23,16 +23,15 @@ PHPAPI HashTable *php_stream_xport_get_hash(void) return &xport_hash; } -PHPAPI int php_stream_xport_register(const char *protocol, php_stream_transport_factory factory) +PHPAPI void php_stream_xport_register(const char *protocol, php_stream_transport_factory factory) { - zend_string *str = zend_string_init_interned(protocol, strlen(protocol), 1); + zend_string *str = zend_string_init_interned(protocol, strlen(protocol), true); zend_hash_update_ptr(&xport_hash, str, factory); - zend_string_release_ex(str, 1); - return SUCCESS; + zend_string_release_ex(str, true); } -PHPAPI int php_stream_xport_unregister(const char *protocol) +PHPAPI zend_result php_stream_xport_unregister(const char *protocol) { return zend_hash_str_del(&xport_hash, protocol, strlen(protocol)); } From 5c4bff65781a6dfc12b7a46860becda7470244f3 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 19 Jul 2026 19:17:50 +0100 Subject: [PATCH 15/15] main: convert sys_temp_dir global to zend_string* (#22812) This removes a strlen() call when we already know the length of the string --- main/main.c | 2 +- main/php_globals.h | 2 +- main/php_open_temporary_file.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/main/main.c b/main/main.c index 4348ec410920..e29770a909eb 100644 --- a/main/main.c +++ b/main/main.c @@ -839,7 +839,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("error_log", NULL, PHP_INI_ALL, OnUpdateErrorLog, error_log, php_core_globals, core_globals) STD_PHP_INI_ENTRY("error_log_mode", "0644", PHP_INI_ALL, OnUpdateLong, error_log_mode, php_core_globals, core_globals) STD_PHP_INI_ENTRY("extension_dir", PHP_EXTENSION_DIR, PHP_INI_SYSTEM, OnUpdateStringUnempty, extension_dir, php_core_globals, core_globals) - STD_PHP_INI_ENTRY("sys_temp_dir", NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, sys_temp_dir, php_core_globals, core_globals) + STD_PHP_INI_ENTRY("sys_temp_dir", NULL, PHP_INI_SYSTEM, OnUpdateStrNotEmpty, sys_temp_dir, php_core_globals, core_globals) STD_PHP_INI_ENTRY("include_path", PHP_INCLUDE_PATH, PHP_INI_ALL, OnUpdateStringUnempty, include_path, php_core_globals, core_globals) PHP_INI_ENTRY("max_execution_time", "30", PHP_INI_ALL, OnUpdateTimeout) STD_PHP_INI_ENTRY("open_basedir", NULL, PHP_INI_ALL, OnUpdateBaseDir, open_basedir, php_core_globals, core_globals) diff --git a/main/php_globals.h b/main/php_globals.h index 8a032e9edb13..0bab9fc95c14 100644 --- a/main/php_globals.h +++ b/main/php_globals.h @@ -83,7 +83,7 @@ struct _php_core_globals { bool open_basedir_modified; char *extension_dir; char *php_binary; - char *sys_temp_dir; + zend_string *sys_temp_dir; char *upload_tmp_dir; zend_long upload_max_filesize; diff --git a/main/php_open_temporary_file.c b/main/php_open_temporary_file.c index ffc1c754d9e6..7a33fa3ce192 100644 --- a/main/php_open_temporary_file.c +++ b/main/php_open_temporary_file.c @@ -240,14 +240,14 @@ PHPAPI const char* php_get_temporary_directory(void) /* Is there a temporary directory "sys_temp_dir" in .ini defined? */ { - char *sys_temp_dir = PG(sys_temp_dir); + const zend_string *sys_temp_dir = PG(sys_temp_dir); if (sys_temp_dir) { - size_t len = strlen(sys_temp_dir); - if (len >= 2 && sys_temp_dir[len - 1] == DEFAULT_SLASH) { - PG(php_sys_temp_dir) = estrndup(sys_temp_dir, len - 1); + size_t len = ZSTR_LEN(sys_temp_dir); + if (len >= 2 && ZSTR_VAL(sys_temp_dir)[len - 1] == DEFAULT_SLASH) { + PG(php_sys_temp_dir) = estrndup(ZSTR_VAL(sys_temp_dir), len - 1); return PG(php_sys_temp_dir); - } else if (len >= 1 && sys_temp_dir[len - 1] != DEFAULT_SLASH) { - PG(php_sys_temp_dir) = estrndup(sys_temp_dir, len); + } else if (len >= 1 && ZSTR_VAL(sys_temp_dir)[len - 1] != DEFAULT_SLASH) { + PG(php_sys_temp_dir) = estrndup(ZSTR_VAL(sys_temp_dir), len); return PG(php_sys_temp_dir); } }