From c21af8c598f07ed3f4363850717e3455c8057be3 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 4 Mar 2026 10:11:00 +0100 Subject: [PATCH 1/4] Backport .github changes for Solaris --- .github/actions/solaris/action.yml | 88 ++++++++++++++++++++++++++++++ .github/matrix.php | 4 ++ .github/workflows/test-suite.yml | 15 +++++ 3 files changed, 107 insertions(+) create mode 100644 .github/actions/solaris/action.yml diff --git a/.github/actions/solaris/action.yml b/.github/actions/solaris/action.yml new file mode 100644 index 0000000000000..ef7cffe32abcb --- /dev/null +++ b/.github/actions/solaris/action.yml @@ -0,0 +1,88 @@ +name: Solaris +inputs: + configurationParameters: + default: '' + required: false + runExtraTests: + default: false + required: false +runs: + using: composite + steps: + - name: Solaris + uses: vmactions/solaris-vm@v1 + with: + release: "11.4-gcc" + usesh: true + copyback: false + disable-cache: true + prepare: | + cd $GITHUB_WORKSPACE + pkg install bison developer/icu libzip oniguruma re2c + + ./buildconf -f + CC=gcc CXX=g++ \ + CFLAGS="-Wno-char-subscripts" \ + PATH=/usr/gnu/bin:/usr/bin \ + PKG_CONFIG_PATH=/usr/lib/amd64/pkgconfig \ + ./configure \ + --prefix=/usr/local \ + --enable-debug \ + --enable-werror \ + --enable-option-checking=fatal \ + --enable-fpm \ + --without-pear \ + --with-bz2 \ + --with-jpeg \ + --with-webp \ + --with-freetype \ + --enable-gd \ + --enable-exif \ + --with-zip \ + --with-zlib \ + --enable-soap \ + --enable-xmlreader \ + --with-xsl \ + --with-libxml \ + --enable-shmop \ + --enable-pcntl \ + --enable-mbstring \ + --with-curl \ + --enable-sockets \ + --with-openssl \ + --enable-bcmath \ + --enable-calendar \ + --enable-ftp \ + --enable-zend-test \ + --enable-dl-test=shared \ + --enable-intl \ + --with-mhash \ + --with-config-file-path=/etc \ + --with-config-file-scan-dir=/etc/php.d \ + ${{ inputs.configurationParameters }} + + gmake -j2 + mkdir /etc/php.d + gmake install > /dev/null + echo opcache.enable_cli=1 > /etc/php.d/opcache.ini + echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini + echo opcache.preload_user=root >> /etc/php.d/opcache.ini + run: | + cd $GITHUB_WORKSPACE + + export SKIP_IO_CAPTURE_TESTS=1 + export CI_NO_IPV6=1 + export STACK_LIMIT_DEFAULTS_CHECK=1 + PATH=/usr/gnu/bin:/usr/bin \ + sapi/cli/php run-tests.php \ + -P -q -j1 \ + -g FAIL,BORK,LEAK,XLEAK \ + --no-progress \ + --offline \ + --show-diff \ + --show-slow 1000 \ + --set-timeout 120 + + if test "${{ inputs.runExtraTests }}" = "true"; then + sapi/cli/php run-extra-tests.php + fi diff --git a/.github/matrix.php b/.github/matrix.php index 64bb60519de6b..2ce59cb657b51 100644 --- a/.github/matrix.php +++ b/.github/matrix.php @@ -62,6 +62,7 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re $test_msan = in_array('CI: MSAN', $labels, true); $test_opcache_variation = in_array('CI: Opcache Variation', $labels, true); $test_pecl = in_array('CI: PECL', $labels, true); + $test_solaris = in_array('CI: Solaris', $labels, true); $test_windows = in_array('CI: Windows', $labels, true); $jobs = []; @@ -132,6 +133,9 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re if (($all_jobs && $ref === 'master') || $test_pecl) { $jobs['PECL'] = true; } + if (version_compare($php_version, '8.6', '>=') && ($all_jobs || $test_solaris)) { + $jobs['SOLARIS'] = true; + } if ($all_jobs || !$no_jobs || $test_windows) { $jobs['WINDOWS']['matrix'] = $all_variations ? ['include' => [ diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 9f5496d1d69cb..83aae655a3c36 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -979,6 +979,21 @@ jobs: configurationParameters: >- --${{ matrix.zts && 'enable' || 'disable' }}-zts runExtraTests: true + SOLARIS: + if: ${{ fromJson(inputs.branch).jobs.SOLARIS }} + name: "SOLARIS" + runs-on: ubuntu-latest + timeout-minutes: 50 + steps: + - name: git checkout + uses: actions/checkout@v5 + with: + ref: ${{ fromJson(inputs.branch).ref }} + - name: Solaris + uses: ./.github/actions/solaris + with: + configurationParameters: --disable-zts + runExtraTests: true BENCHMARKING: name: BENCHMARKING if: ${{ fromJson(inputs.branch).jobs.BENCHMARKING }} From ce1cadba291c758c0dfa7a82c0078a0d2edfaa52 Mon Sep 17 00:00:00 2001 From: Petr Sumbera Date: Fri, 12 Dec 2025 07:21:39 -0500 Subject: [PATCH 2/4] Fix Solaris tests and add nightly CI job Closes GH-20709 --- .github/actions/solaris/action.yml | 88 +++++++++++ .github/matrix.php | 4 + .github/workflows/test-suite.yml | 15 ++ Zend/tests/stack_limit/stack_limit_010.phpt | 4 +- ext/calendar/tests/unixtojd.phpt | 6 + ext/ctype/tests/bug25745.phpt | 6 + ext/date/tests/bug33532.phpt | 2 +- ext/date/tests/gmstrftime_variation16.phpt | 3 + ext/date/tests/strftime_variation16.phpt | 3 + ext/fileinfo/tests/finfo_upstream.phpt | 6 + ext/iconv/tests/bug37773.phpt | 3 + ext/iconv/tests/bug52211.phpt | 6 + ext/iconv/tests/bug69840.phpt | 6 + ext/iconv/tests/eucjp2iso2022jp.phpt | 6 + ext/iconv/tests/iconv003.phpt | 6 + ext/iconv/tests/iconv_basic_001.phpt | 1 + ext/iconv/tests/iconv_mime_encode.phpt | 6 + ext/iconv/tests/iconv_strrpos.phpt | 6 + .../tests/iconv_substr_out_of_bounds.phpt | 6 + ext/libxml/tests/bug61367-write.phpt | 2 +- ext/mysqli/tests/gh9590.phpt | 2 + ext/pcntl/tests/pcntl_cpuaffinity.phpt | 3 + ext/pcntl/tests/pcntl_getcpu.phpt | 1 + ext/posix/tests/posix_fpathconf.phpt | 2 +- .../tests/posix_isatty_value_errors.phpt | 6 +- .../tests/posix_ttyname_value_errors.phpt | 4 +- ext/soap/php_encoding.c | 4 +- ext/sockets/tests/gh20532.phpt | 2 +- .../tests/socket_addrinfo_explain.phpt | 7 +- ext/sockets/tests/socket_afpacket.phpt | 3 + .../tests/socket_create_pair-wrongparams.phpt | 2 +- ext/sockets/tests/socket_export_stream-4.phpt | 8 +- ext/sockets/tests/socket_import_stream-4.phpt | 8 +- ext/sockets/tests/socket_tcp_congestion.phpt | 3 + ext/standard/tests/file/005_variation2.phpt | 1 + ext/standard/tests/file/007_variation1.phpt | 2 +- ext/standard/tests/file/007_variation11.phpt | 2 +- ext/standard/tests/file/007_variation13.phpt | 2 +- ext/standard/tests/file/007_variation15.phpt | 2 +- ext/standard/tests/file/007_variation17.phpt | 2 +- ext/standard/tests/file/007_variation19.phpt | 2 +- ext/standard/tests/file/007_variation21.phpt | 2 +- ext/standard/tests/file/007_variation23.phpt | 2 +- ext/standard/tests/file/007_variation3.phpt | 2 +- ext/standard/tests/file/007_variation5.phpt | 2 +- ext/standard/tests/file/007_variation7.phpt | 2 +- ext/standard/tests/file/007_variation9.phpt | 2 +- ext/standard/tests/file/bug35781.phpt | 2 +- ext/standard/tests/file/bug65272.phpt | 6 + ext/standard/tests/file/fdatasync.phpt | 7 +- ext/standard/tests/file/fgetc_variation3.phpt | 18 +-- ext/standard/tests/file/fgets_variation1.phpt | 18 +-- .../tests/file/filetype_variation2.phpt | 8 +- ext/standard/tests/file/flock.phpt | 8 +- ext/standard/tests/file/flock_basic.phpt | 8 +- ext/standard/tests/file/flock_variation.phpt | 8 +- ext/standard/tests/file/fread_variation2.phpt | 144 +++++++++--------- ext/standard/tests/file/fread_variation4.phpt | 108 ++++++------- .../tests/file/fscanf_variation51.phpt | 126 +++++++-------- ext/standard/tests/file/fsync.phpt | 7 +- ext/standard/tests/file/fwrite.phpt | 2 +- .../tests/file/fwrite_variation1.phpt | 48 +++--- .../tests/file/lstat_stat_variation18.phpt | 4 +- .../tests/file/lstat_stat_variation19.phpt | 8 +- .../tests/file/lstat_stat_variation20.phpt | 8 +- .../tests/file/open_basedir_cwd_resolve.phpt | 2 +- .../tests/file/popen_pclose_error-sunos.phpt | 48 ------ .../tests/file/realpath_bug77484.phpt | 4 +- ext/standard/tests/filters/bug35916.phpt | 2 +- ext/standard/tests/filters/gh17345.phpt | 2 +- .../getservbyname_basic.phpt | 3 + .../general_functions/proc_nice_basic.phpt | 1 + .../tests/network/ip2long_variation2_x64.phpt | 1 + .../tests/network/syslog_new_line.phpt | 2 + .../tests/network/syslog_null_byte.phpt | 2 + ext/standard/tests/streams/bug54946.phpt | 6 +- ext/standard/tests/streams/gh9590-001.phpt | 2 + ext/standard/tests/streams/gh9590-002.phpt | 2 + ext/standard/tests/streams/glob-wrapper.phpt | 2 +- .../tests/strings/setlocale_basic1.phpt | 6 +- .../tests/strings/setlocale_basic2.phpt | 7 +- .../tests/strings/setlocale_basic3.phpt | 33 ++-- .../tests/strings/setlocale_variation1.phpt | 34 +++-- .../tests/strings/setlocale_variation2.phpt | 3 + ext/standard/tests/time/strptime_basic.phpt | 4 +- ...teVars_modification_validation_bypass.phpt | 4 +- ext/zend_test/tests/gh11078.phpt | 1 + ext/zlib/tests/zlib_wrapper_flock_basic.phpt | 6 + sapi/cli/tests/cli_process_title_unix.phpt | 3 + 89 files changed, 611 insertions(+), 372 deletions(-) create mode 100644 .github/actions/solaris/action.yml delete mode 100644 ext/standard/tests/file/popen_pclose_error-sunos.phpt diff --git a/.github/actions/solaris/action.yml b/.github/actions/solaris/action.yml new file mode 100644 index 0000000000000..ef7cffe32abcb --- /dev/null +++ b/.github/actions/solaris/action.yml @@ -0,0 +1,88 @@ +name: Solaris +inputs: + configurationParameters: + default: '' + required: false + runExtraTests: + default: false + required: false +runs: + using: composite + steps: + - name: Solaris + uses: vmactions/solaris-vm@v1 + with: + release: "11.4-gcc" + usesh: true + copyback: false + disable-cache: true + prepare: | + cd $GITHUB_WORKSPACE + pkg install bison developer/icu libzip oniguruma re2c + + ./buildconf -f + CC=gcc CXX=g++ \ + CFLAGS="-Wno-char-subscripts" \ + PATH=/usr/gnu/bin:/usr/bin \ + PKG_CONFIG_PATH=/usr/lib/amd64/pkgconfig \ + ./configure \ + --prefix=/usr/local \ + --enable-debug \ + --enable-werror \ + --enable-option-checking=fatal \ + --enable-fpm \ + --without-pear \ + --with-bz2 \ + --with-jpeg \ + --with-webp \ + --with-freetype \ + --enable-gd \ + --enable-exif \ + --with-zip \ + --with-zlib \ + --enable-soap \ + --enable-xmlreader \ + --with-xsl \ + --with-libxml \ + --enable-shmop \ + --enable-pcntl \ + --enable-mbstring \ + --with-curl \ + --enable-sockets \ + --with-openssl \ + --enable-bcmath \ + --enable-calendar \ + --enable-ftp \ + --enable-zend-test \ + --enable-dl-test=shared \ + --enable-intl \ + --with-mhash \ + --with-config-file-path=/etc \ + --with-config-file-scan-dir=/etc/php.d \ + ${{ inputs.configurationParameters }} + + gmake -j2 + mkdir /etc/php.d + gmake install > /dev/null + echo opcache.enable_cli=1 > /etc/php.d/opcache.ini + echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini + echo opcache.preload_user=root >> /etc/php.d/opcache.ini + run: | + cd $GITHUB_WORKSPACE + + export SKIP_IO_CAPTURE_TESTS=1 + export CI_NO_IPV6=1 + export STACK_LIMIT_DEFAULTS_CHECK=1 + PATH=/usr/gnu/bin:/usr/bin \ + sapi/cli/php run-tests.php \ + -P -q -j1 \ + -g FAIL,BORK,LEAK,XLEAK \ + --no-progress \ + --offline \ + --show-diff \ + --show-slow 1000 \ + --set-timeout 120 + + if test "${{ inputs.runExtraTests }}" = "true"; then + sapi/cli/php run-extra-tests.php + fi diff --git a/.github/matrix.php b/.github/matrix.php index 64bb60519de6b..2ce59cb657b51 100644 --- a/.github/matrix.php +++ b/.github/matrix.php @@ -62,6 +62,7 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re $test_msan = in_array('CI: MSAN', $labels, true); $test_opcache_variation = in_array('CI: Opcache Variation', $labels, true); $test_pecl = in_array('CI: PECL', $labels, true); + $test_solaris = in_array('CI: Solaris', $labels, true); $test_windows = in_array('CI: Windows', $labels, true); $jobs = []; @@ -132,6 +133,9 @@ function select_jobs($repository, $trigger, $nightly, $labels, $php_version, $re if (($all_jobs && $ref === 'master') || $test_pecl) { $jobs['PECL'] = true; } + if (version_compare($php_version, '8.6', '>=') && ($all_jobs || $test_solaris)) { + $jobs['SOLARIS'] = true; + } if ($all_jobs || !$no_jobs || $test_windows) { $jobs['WINDOWS']['matrix'] = $all_variations ? ['include' => [ diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 9f5496d1d69cb..83aae655a3c36 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -979,6 +979,21 @@ jobs: configurationParameters: >- --${{ matrix.zts && 'enable' || 'disable' }}-zts runExtraTests: true + SOLARIS: + if: ${{ fromJson(inputs.branch).jobs.SOLARIS }} + name: "SOLARIS" + runs-on: ubuntu-latest + timeout-minutes: 50 + steps: + - name: git checkout + uses: actions/checkout@v5 + with: + ref: ${{ fromJson(inputs.branch).ref }} + - name: Solaris + uses: ./.github/actions/solaris + with: + configurationParameters: --disable-zts + runExtraTests: true BENCHMARKING: name: BENCHMARKING if: ${{ fromJson(inputs.branch).jobs.BENCHMARKING }} diff --git a/Zend/tests/stack_limit/stack_limit_010.phpt b/Zend/tests/stack_limit/stack_limit_010.phpt index 4f8358fb41e71..85736423e41ee 100644 --- a/Zend/tests/stack_limit/stack_limit_010.phpt +++ b/Zend/tests/stack_limit/stack_limit_010.phpt @@ -27,7 +27,9 @@ $expectedMaxSize = match(php_uname('s')) { 'true' => 16*1024*1024, // https://github.com/actions/runner-images/pull/3328 default => 8*1024*1024, }, - 'SunOS' => 10 * 1024 * 1024, + 'SunOS' => preg_match('/(omnios|illumos|smartos|oi-|openindiana|joyent)/i', php_uname('v')) + ? 10 * 1024 * 1024 + : 8 * 1024 * 1024, 'Windows NT' => 67108864 - 4*4096, // Set by sapi/cli/config.w32 }; diff --git a/ext/calendar/tests/unixtojd.phpt b/ext/calendar/tests/unixtojd.phpt index 3d0ffa3fea30e..c96c9695dc502 100644 --- a/ext/calendar/tests/unixtojd.phpt +++ b/ext/calendar/tests/unixtojd.phpt @@ -1,5 +1,11 @@ --TEST-- unixtojd() +--SKIPIF-- + --EXTENSIONS-- calendar --ENV-- diff --git a/ext/ctype/tests/bug25745.phpt b/ext/ctype/tests/bug25745.phpt index 420d2c18807ef..935ce4726ce01 100644 --- a/ext/ctype/tests/bug25745.phpt +++ b/ext/ctype/tests/bug25745.phpt @@ -2,6 +2,12 @@ Bug #25745 (ctype functions fail with non-ascii characters) --EXTENSIONS-- ctype +--SKIPIF-- + --INI-- error_reporting=E_ALL&~E_DEPRECATED --FILE-- diff --git a/ext/date/tests/bug33532.phpt b/ext/date/tests/bug33532.phpt index 7734cc955c7fd..a107650528ca5 100644 --- a/ext/date/tests/bug33532.phpt +++ b/ext/date/tests/bug33532.phpt @@ -5,7 +5,7 @@ error_reporting=2047 date.timezone=UTC --SKIPIF-- --FILE-- diff --git a/ext/date/tests/gmstrftime_variation16.phpt b/ext/date/tests/gmstrftime_variation16.phpt index d80e19ef4f696..eca0618af1687 100644 --- a/ext/date/tests/gmstrftime_variation16.phpt +++ b/ext/date/tests/gmstrftime_variation16.phpt @@ -5,6 +5,9 @@ Test gmstrftime() function : usage variation - Checking time related formats whi if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') { die("skip Test is not valid for Windows"); } +if (PHP_OS_FAMILY === 'Solaris') { + die("skip Solaris uses ' 8:08:08 AM' for %r (time format differs)"); +} ?> --FILE-- --FILE-- --ENV-- TZ=UTC --FILE-- diff --git a/ext/iconv/tests/bug37773.phpt b/ext/iconv/tests/bug37773.phpt index 4dcdd56b3cb53..1d1b8f569ed1e 100644 --- a/ext/iconv/tests/bug37773.phpt +++ b/ext/iconv/tests/bug37773.phpt @@ -10,6 +10,9 @@ if ($test === false) { die("skip UTF-8 is not supported?"); } +if (PHP_OS_FAMILY === 'Solaris') { + die("skip Solaris iconv behaves differently"); +} ?> --FILE-- --FILE-- --FILE-- --INI-- error_reporting=2039 --FILE-- diff --git a/ext/iconv/tests/iconv003.phpt b/ext/iconv/tests/iconv003.phpt index 86e2e207b2a13..f3c2da39ed780 100644 --- a/ext/iconv/tests/iconv003.phpt +++ b/ext/iconv/tests/iconv003.phpt @@ -2,6 +2,12 @@ iconv() test 3 --EXTENSIONS-- iconv +--SKIPIF-- + --FILE-- --FILE-- --FILE-- --INI-- iconv.internal_charset=ISO-8859-1 --FILE-- diff --git a/ext/iconv/tests/iconv_substr_out_of_bounds.phpt b/ext/iconv/tests/iconv_substr_out_of_bounds.phpt index fa335ccc22e63..7f4c28ae11fc9 100644 --- a/ext/iconv/tests/iconv_substr_out_of_bounds.phpt +++ b/ext/iconv/tests/iconv_substr_out_of_bounds.phpt @@ -2,6 +2,12 @@ iconv_substr() with out of bounds offset --EXTENSIONS-- iconv +--SKIPIF-- + --FILE-- --FILE-- --FILE-- diff --git a/ext/pcntl/tests/pcntl_getcpu.phpt b/ext/pcntl/tests/pcntl_getcpu.phpt index b7e84a291d912..2250fde3a1b1e 100644 --- a/ext/pcntl/tests/pcntl_getcpu.phpt +++ b/ext/pcntl/tests/pcntl_getcpu.phpt @@ -7,6 +7,7 @@ pcntl if (!function_exists("pcntl_getcpu")) die("skip pcntl_getcpu() is not available"); if (!function_exists("pcntl_setcpuaffinity")) die("skip pcntl_setcpuaffinity() is not available"); if (getenv('SKIP_REPEAT')) die("skip Not repeatable"); +if (PHP_OS_FAMILY === 'Solaris') die("skip doesn't work on Solaris"); ?> --FILE-- tm_gmtoff / 3600), labs( (ta->tm_gmtoff % 3600) / 60 )); #else # if defined(__CYGWIN__) || (defined(PHP_WIN32) && defined(_MSC_VER)) - snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", ((ta->tm_isdst ? _timezone - 3600:_timezone)>0)?'-':'+', abs((ta->tm_isdst ? _timezone - 3600 : _timezone) / 3600), abs(((ta->tm_isdst ? _timezone - 3600 : _timezone) % 3600) / 60)); + snprintf(tzbuf, sizeof(tzbuf), "%c%02ld:%02ld", ((ta->tm_isdst ? _timezone - 3600:_timezone)>0)?'-':'+', labs((ta->tm_isdst ? _timezone - 3600 : _timezone) / 3600), labs(((ta->tm_isdst ? _timezone - 3600 : _timezone) % 3600) / 60)); # else - snprintf(tzbuf, sizeof(tzbuf), "%c%02d:%02d", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', abs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), abs(((ta->tm_isdst ? timezone - 3600 : timezone) % 3600) / 60)); + snprintf(tzbuf, sizeof(tzbuf), "%c%02ld:%02ld", ((ta->tm_isdst ? timezone - 3600:timezone)>0)?'-':'+', labs((ta->tm_isdst ? timezone - 3600 : timezone) / 3600), labs(((ta->tm_isdst ? timezone - 3600 : timezone) % 3600) / 60)); # endif #endif if (strcmp(tzbuf,"+00:00") == 0) { diff --git a/ext/sockets/tests/gh20532.phpt b/ext/sockets/tests/gh20532.phpt index f3368c830369a..360f9e7e11a8b 100644 --- a/ext/sockets/tests/gh20532.phpt +++ b/ext/sockets/tests/gh20532.phpt @@ -5,7 +5,7 @@ sockets --FILE-- AF_INET], $error_code) === false && in_array($error_code, [EAI_FAMILY, EAI_ADDRFAMILY, EAI_NONAME, EAI_NODATA])); var_dump(socket_addrinfo_lookup("example.com", "http", ['ai_socktype' => SOCK_RAW, 'ai_flags' => 2147483647], $error_code) === false && in_array($error_code, [EAI_SOCKTYPE, EAI_SERVICE, EAI_BADFLAGS, EAI_NONAME])); ?> diff --git a/ext/sockets/tests/socket_addrinfo_explain.phpt b/ext/sockets/tests/socket_addrinfo_explain.phpt index e06ed36a64ec8..ef516b9664960 100644 --- a/ext/sockets/tests/socket_addrinfo_explain.phpt +++ b/ext/sockets/tests/socket_addrinfo_explain.phpt @@ -12,6 +12,11 @@ $result = socket_addrinfo_explain($addrinfo[0]); // Musl sets ai_canonname even if AI_CANONNAME is not specified. unset($result['ai_canonname']); var_dump($result); +// Solaris uses different numeric values for SOCK_* constants, +// so avoid comparing raw integers in EXPECTF. +if ($result['ai_socktype'] != SOCK_DGRAM) { + echo "Wrong socktype\n"; +} echo "Done"; ?> --EXPECTF-- @@ -21,7 +26,7 @@ array(5) { ["ai_family"]=> int(2) ["ai_socktype"]=> - int(2) + int(%s) ["ai_protocol"]=> int(%d) ["ai_addr"]=> diff --git a/ext/sockets/tests/socket_afpacket.phpt b/ext/sockets/tests/socket_afpacket.phpt index 2e83a654766e0..a707ad48fa7a8 100644 --- a/ext/sockets/tests/socket_afpacket.phpt +++ b/ext/sockets/tests/socket_afpacket.phpt @@ -9,6 +9,9 @@ posix if (!defined("AF_PACKET")) { die('SKIP AF_PACKET not supported on this platform.'); } +if (!defined("ETH_P_IP")) { + die('SKIP ETH_P_IP not available on this platform.'); +} if (!function_exists("posix_getuid") || posix_getuid() != 0) { die('SKIP AF_PACKET requires root permissions.'); } diff --git a/ext/sockets/tests/socket_create_pair-wrongparams.phpt b/ext/sockets/tests/socket_create_pair-wrongparams.phpt index 8877e3d5b99ea..1d0a6540841dd 100644 --- a/ext/sockets/tests/socket_create_pair-wrongparams.phpt +++ b/ext/sockets/tests/socket_create_pair-wrongparams.phpt @@ -27,7 +27,7 @@ try { ?> --EXPECTF-- -Warning: socket_create_pair(): Unable to create socket pair [%d]: %s not supported in %s on line %d +Warning: socket_create_pair(): Unable to create socket pair [%d]: %s %r(not supported|wrong type for socket)%r in %s on line %d bool(false) socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A diff --git a/ext/sockets/tests/socket_export_stream-4.phpt b/ext/sockets/tests/socket_export_stream-4.phpt index a3879a93b7cd8..168671138680e 100644 --- a/ext/sockets/tests/socket_export_stream-4.phpt +++ b/ext/sockets/tests/socket_export_stream-4.phpt @@ -32,7 +32,9 @@ function test($stream, $sock) { echo "\n"; echo "socket_get_option "; try { - print_r(socket_get_option($sock, SOL_SOCKET, SO_TYPE)); + // Solaris uses different numeric values for SOCK_* constants + $opt = socket_get_option($sock, SOL_SOCKET, SO_TYPE); + print_r($opt === SOCK_DGRAM ? "DGRAM" : $opt); } catch (Error $e) { echo get_class($e), ": ", $e->getMessage(), "\n"; } @@ -81,12 +83,12 @@ echo "Done.\n"; normal stream_set_blocking 1 socket_set_block 1 -socket_get_option 2 +socket_get_option DGRAM unset stream socket_set_block 1 -socket_get_option 2 +socket_get_option DGRAM unset socket diff --git a/ext/sockets/tests/socket_import_stream-4.phpt b/ext/sockets/tests/socket_import_stream-4.phpt index efe987dfdce28..87ca608b862b9 100644 --- a/ext/sockets/tests/socket_import_stream-4.phpt +++ b/ext/sockets/tests/socket_import_stream-4.phpt @@ -31,7 +31,9 @@ function test($stream, $sock) { echo "\n"; echo "socket_get_option "; try { - print_r(socket_get_option($sock, SOL_SOCKET, SO_TYPE)); + // Solaris uses different numeric values for SOCK_* constants + $opt = socket_get_option($sock, SOL_SOCKET, SO_TYPE); + print_r($opt === SOCK_DGRAM ? "DGRAM" : $opt); } catch (Error $e) { echo get_class($e), ": ", $e->getMessage(), "\n"; } @@ -75,12 +77,12 @@ echo "Done.\n"; normal stream_set_blocking 1 socket_set_block 1 -socket_get_option 2 +socket_get_option DGRAM unset stream socket_set_block 1 -socket_get_option 2 +socket_get_option DGRAM unset socket diff --git a/ext/sockets/tests/socket_tcp_congestion.phpt b/ext/sockets/tests/socket_tcp_congestion.phpt index 56b587618548a..45853f6bf8ce2 100644 --- a/ext/sockets/tests/socket_tcp_congestion.phpt +++ b/ext/sockets/tests/socket_tcp_congestion.phpt @@ -7,6 +7,9 @@ sockets if (!defined('TCP_CONGESTION')) { die('skip TCP_CONGESTION test'); } +if (PHP_OS_FAMILY === 'Solaris' ) { + die("skip Solaris does not allow setting TCP_CONGESTION"); +} ?> --FILE-- --EXPECTF-- -Notice: fpassthru(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fpassthru(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d string(15) "Guvf vf n grfg " Done diff --git a/ext/standard/tests/file/bug65272.phpt b/ext/standard/tests/file/bug65272.phpt index 24e50d15bee34..0419a7023d69c 100644 --- a/ext/standard/tests/file/bug65272.phpt +++ b/ext/standard/tests/file/bug65272.phpt @@ -1,5 +1,11 @@ --TEST-- Bug #65272: flock() correctly sets wouldblock out param in windows +--SKIPIF-- + --FILE-- --FILE-- --EXPECT-- -- Checking for char -- diff --git a/ext/standard/tests/file/flock.phpt b/ext/standard/tests/file/flock.phpt index a3c1804584023..0e07114f9cd49 100644 --- a/ext/standard/tests/file/flock.phpt +++ b/ext/standard/tests/file/flock.phpt @@ -14,7 +14,13 @@ try { echo $e->getMessage(), "\n"; } -$fp = fopen($file, "w"); +/* + On Solaris, flock() is emulated via fcntl(). A shared lock (LOCK_SH) maps to + F_RDLCK, which requires the file descriptor to be open for reading. Using "w" + opens write-only and causes EBADF on Solaris. Open with "w+" so LOCK_SH works + portably across platforms. +*/ +$fp = fopen($file, "w+"); var_dump(flock($fp, LOCK_SH|LOCK_NB)); var_dump(flock($fp, LOCK_UN)); diff --git a/ext/standard/tests/file/flock_basic.phpt b/ext/standard/tests/file/flock_basic.phpt index 8b4ae30e0fd45..4fd4ea1e931fa 100644 --- a/ext/standard/tests/file/flock_basic.phpt +++ b/ext/standard/tests/file/flock_basic.phpt @@ -11,7 +11,13 @@ echo "*** Testing flock() fun with file and dir ***\n"; $lock_file = preg_replace("~\.phpt?$~", '', __FILE__); -$file_handle = fopen($lock_file, "w"); +/* + On Solaris, flock() is emulated via fcntl(). A shared lock (LOCK_SH) maps to + F_RDLCK, which requires the file descriptor to be open for reading. Using "w" + opens write-only and causes EBADF on Solaris. Open with "w+" so LOCK_SH works + portably across platforms. +*/ +$file_handle = fopen($lock_file, "w+"); var_dump(flock($file_handle, LOCK_SH|LOCK_NB)); var_dump(flock($file_handle, LOCK_UN)); var_dump(flock($file_handle, LOCK_EX)); diff --git a/ext/standard/tests/file/flock_variation.phpt b/ext/standard/tests/file/flock_variation.phpt index 1d73e90d254d4..1b17635db1cbb 100644 --- a/ext/standard/tests/file/flock_variation.phpt +++ b/ext/standard/tests/file/flock_variation.phpt @@ -6,7 +6,13 @@ echo "*** Testing flock() fun with the various operation and wouldblock values ***\n"; $file = preg_replace("~\.phpt?$~", '', __FILE__); -$fp = fopen($file, "w"); +/* + On Solaris, flock() is emulated via fcntl(). A shared lock (LOCK_SH) maps to + F_RDLCK, which requires the file descriptor to be open for reading. Using "w" + opens write-only and causes EBADF on Solaris. Open with "w+" so LOCK_SH works + portably across platforms. +*/ +$fp = fopen($file, "w+"); /* array of operations */ $operations = array( diff --git a/ext/standard/tests/file/fread_variation2.phpt b/ext/standard/tests/file/fread_variation2.phpt index a16c97a745aeb..1fee493c4b696 100644 --- a/ext/standard/tests/file/fread_variation2.phpt +++ b/ext/standard/tests/file/fread_variation2.phpt @@ -104,7 +104,7 @@ echo "Done\n"; int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -113,7 +113,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -123,7 +123,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -132,7 +132,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -142,7 +142,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -151,7 +151,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -161,7 +161,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -170,7 +170,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -180,7 +180,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -189,7 +189,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -199,7 +199,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -208,7 +208,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -218,7 +218,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -227,7 +227,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -237,7 +237,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -246,7 +246,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -256,7 +256,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -265,7 +265,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -277,7 +277,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -286,7 +286,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -296,7 +296,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -305,7 +305,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -315,7 +315,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -324,7 +324,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -334,7 +334,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -343,7 +343,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -353,7 +353,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -362,7 +362,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -372,7 +372,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -381,7 +381,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -391,7 +391,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -400,7 +400,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -410,7 +410,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -419,7 +419,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -429,7 +429,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -438,7 +438,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -450,7 +450,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -459,7 +459,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -469,7 +469,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -478,7 +478,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -488,7 +488,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -497,7 +497,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -507,7 +507,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -516,7 +516,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -526,7 +526,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -535,7 +535,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -545,7 +545,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -554,7 +554,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -564,7 +564,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -573,7 +573,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -583,7 +583,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -592,7 +592,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -602,7 +602,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -611,7 +611,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -623,7 +623,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -632,7 +632,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -642,7 +642,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -651,7 +651,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -661,7 +661,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -670,7 +670,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -680,7 +680,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -689,7 +689,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -699,7 +699,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -708,7 +708,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -718,7 +718,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -727,7 +727,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -737,7 +737,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -746,7 +746,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -756,7 +756,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -765,7 +765,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -775,7 +775,7 @@ bool(false) int(0) bool(false) Reading 1024 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -784,7 +784,7 @@ bool(false) int(0) bool(false) Reading 1000 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) diff --git a/ext/standard/tests/file/fread_variation4.phpt b/ext/standard/tests/file/fread_variation4.phpt index 97c6c39f9c8cf..1ed43464f88f0 100644 --- a/ext/standard/tests/file/fread_variation4.phpt +++ b/ext/standard/tests/file/fread_variation4.phpt @@ -102,7 +102,7 @@ echo"Done\n"; int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -110,7 +110,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -119,7 +119,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -127,7 +127,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -136,7 +136,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -144,7 +144,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -153,7 +153,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -161,7 +161,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -170,7 +170,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -178,7 +178,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -187,7 +187,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -195,7 +195,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -204,7 +204,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -212,7 +212,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -221,7 +221,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -229,7 +229,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -238,7 +238,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -246,7 +246,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -257,7 +257,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -265,7 +265,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -274,7 +274,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -282,7 +282,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -291,7 +291,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -299,7 +299,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -308,7 +308,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -316,7 +316,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -325,7 +325,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -333,7 +333,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -342,7 +342,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -350,7 +350,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -359,7 +359,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -367,7 +367,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -376,7 +376,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -384,7 +384,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -393,7 +393,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -401,7 +401,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -412,7 +412,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -420,7 +420,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -429,7 +429,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -437,7 +437,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -446,7 +446,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -454,7 +454,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -463,7 +463,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -471,7 +471,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -480,7 +480,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -488,7 +488,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -497,7 +497,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -505,7 +505,7 @@ bool(false) int(%r1024|1137%r) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(%r1024|1137%r) bool(false) @@ -514,7 +514,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -522,7 +522,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -531,7 +531,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -539,7 +539,7 @@ bool(false) int(1024) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(1024) bool(false) @@ -548,7 +548,7 @@ bool(false) int(0) bool(false) Reading 1030 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(0) bool(false) @@ -556,7 +556,7 @@ bool(false) int(%r1024|1137%r) bool(false) Reading 10 bytes from file, expecting 0 bytes ... -Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fread(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d OK int(%r1024|1137%r) bool(false) diff --git a/ext/standard/tests/file/fscanf_variation51.phpt b/ext/standard/tests/file/fscanf_variation51.phpt index fad6132748282..97e56c1bab8da 100644 --- a/ext/standard/tests/file/fscanf_variation51.phpt +++ b/ext/standard/tests/file/fscanf_variation51.phpt @@ -65,209 +65,209 @@ if(file_exists($filename)) { -- iteration 1 -- -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -- iteration 2 -- -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -- iteration 3 -- -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -- iteration 4 -- -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -- iteration 5 -- -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -- iteration 6 -- -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -- iteration 7 -- -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -- iteration 8 -- -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -- iteration 9 -- -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) -Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fscanf(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) *** Done *** diff --git a/ext/standard/tests/file/fsync.phpt b/ext/standard/tests/file/fsync.phpt index 7a036a55d4d0d..dfa7404caa57e 100644 --- a/ext/standard/tests/file/fsync.phpt +++ b/ext/standard/tests/file/fsync.phpt @@ -34,7 +34,12 @@ fclose($file_handle); echo "\n*** Testing fsync(): attempting to sync stdin ***\n"; $file_handle = fopen("php://stdin", "w"); -var_dump(fsync($file_handle)); +// On Solaris, fsync() on stdin returns success +if (PHP_OS_FAMILY === 'Solaris') { + var_dump(!fsync($file_handle)); +} else { + var_dump(fsync($file_handle)); +} fclose($file_handle); echo "\n*** Testing fsync(): for non-file stream ***\n"; diff --git a/ext/standard/tests/file/fwrite.phpt b/ext/standard/tests/file/fwrite.phpt index 12bfb6727ec31..e29c6a3507de9 100644 --- a/ext/standard/tests/file/fwrite.phpt +++ b/ext/standard/tests/file/fwrite.phpt @@ -29,7 +29,7 @@ $filename = __DIR__."/fwrite.dat"; --EXPECTF-- int(0) -Notice: fwrite(): Write of 4 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 4 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) int(4) diff --git a/ext/standard/tests/file/fwrite_variation1.phpt b/ext/standard/tests/file/fwrite_variation1.phpt index 34a1c89c6939b..3660cffae8fe6 100644 --- a/ext/standard/tests/file/fwrite_variation1.phpt +++ b/ext/standard/tests/file/fwrite_variation1.phpt @@ -68,13 +68,13 @@ echo "Done\n"; -- Opening file in r -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) @@ -84,13 +84,13 @@ string(32) "950b7457d1deb6332f2fc5d42f3129d6" -- Opening file in rb -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) @@ -100,13 +100,13 @@ string(32) "950b7457d1deb6332f2fc5d42f3129d6" -- Opening file in rt -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) @@ -118,13 +118,13 @@ string(32) "950b7457d1deb6332f2fc5d42f3129d6" -- Opening file in r -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) @@ -134,13 +134,13 @@ string(32) "e486000c4c8452774f746a27658d87fa" -- Opening file in rb -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) @@ -150,13 +150,13 @@ string(32) "e486000c4c8452774f746a27658d87fa" -- Opening file in rt -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) @@ -168,13 +168,13 @@ string(32) "e486000c4c8452774f746a27658d87fa" -- Opening file in r -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) @@ -184,13 +184,13 @@ string(32) "b09c8026a64a88d36d4c2f17983964bb" -- Opening file in rb -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) @@ -200,13 +200,13 @@ string(32) "b09c8026a64a88d36d4c2f17983964bb" -- Opening file in rt -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) @@ -218,13 +218,13 @@ string(32) "b09c8026a64a88d36d4c2f17983964bb" -- Opening file in r -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) @@ -234,13 +234,13 @@ string(32) "3fabd48d8eaa65c14e0d93d6880c560c" -- Opening file in rb -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) @@ -250,13 +250,13 @@ string(32) "3fabd48d8eaa65c14e0d93d6880c560c" -- Opening file in rt -- int(0) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(0) bool(false) int(2) -Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: fwrite(): Write of 1024 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d bool(false) int(2) bool(false) diff --git a/ext/standard/tests/file/lstat_stat_variation18.phpt b/ext/standard/tests/file/lstat_stat_variation18.phpt index e3c8386e70f1d..9291de269396a 100644 --- a/ext/standard/tests/file/lstat_stat_variation18.phpt +++ b/ext/standard/tests/file/lstat_stat_variation18.phpt @@ -62,7 +62,7 @@ array(26) { [5]=> int(%d) [6]=> - int(%d) + int(%i) [7]=> int(%d) [8]=> @@ -118,7 +118,7 @@ array(26) { [5]=> int(%d) [6]=> - int(%d) + int(%i) [7]=> int(%d) [8]=> diff --git a/ext/standard/tests/file/lstat_stat_variation19.phpt b/ext/standard/tests/file/lstat_stat_variation19.phpt index 18ad03e52d29c..24af43599efa2 100644 --- a/ext/standard/tests/file/lstat_stat_variation19.phpt +++ b/ext/standard/tests/file/lstat_stat_variation19.phpt @@ -63,7 +63,7 @@ array(26) { [5]=> int(%d) [6]=> - int(%d) + int(%i) [7]=> int(%d) [8]=> @@ -117,7 +117,7 @@ array(26) { [5]=> int(%d) [6]=> - int(%d) + int(%i) [7]=> int(%d) [8]=> @@ -173,7 +173,7 @@ array(26) { [5]=> int(%d) [6]=> - int(%d) + int(%i) [7]=> int(%d) [8]=> @@ -227,7 +227,7 @@ array(26) { [5]=> int(%d) [6]=> - int(%d) + int(%i) [7]=> int(%d) [8]=> diff --git a/ext/standard/tests/file/lstat_stat_variation20.phpt b/ext/standard/tests/file/lstat_stat_variation20.phpt index 5bff0456eba5e..cfff4571ae160 100644 --- a/ext/standard/tests/file/lstat_stat_variation20.phpt +++ b/ext/standard/tests/file/lstat_stat_variation20.phpt @@ -72,7 +72,7 @@ array(26) { [5]=> int(%d) [6]=> - int(%d) + int(%i) [7]=> int(%d) [8]=> @@ -128,7 +128,7 @@ array(26) { [5]=> int(%d) [6]=> - int(%d) + int(%i) [7]=> int(%d) [8]=> @@ -182,7 +182,7 @@ array(26) { [5]=> int(%d) [6]=> - int(%d) + int(%i) [7]=> int(%d) [8]=> @@ -236,7 +236,7 @@ array(26) { [5]=> int(%d) [6]=> - int(%d) + int(%i) [7]=> int(%d) [8]=> diff --git a/ext/standard/tests/file/open_basedir_cwd_resolve.phpt b/ext/standard/tests/file/open_basedir_cwd_resolve.phpt index 753e21d997dda..9c95e4904fa04 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: Operation not permitted 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 bool(false) diff --git a/ext/standard/tests/file/popen_pclose_error-sunos.phpt b/ext/standard/tests/file/popen_pclose_error-sunos.phpt deleted file mode 100644 index 981f1d5a6e6aa..0000000000000 --- a/ext/standard/tests/file/popen_pclose_error-sunos.phpt +++ /dev/null @@ -1,48 +0,0 @@ ---TEST-- -Test popen() and pclose function: error conditions ---SKIPIF-- - ---FILE-- - ---CLEAN-- - ---EXPECTF-- -*** Testing for error conditions *** - -Warning: Wrong parameter count for popen() in %s on line %d -NULL - -Warning: Wrong parameter count for popen() in %s on line %d -NULL -sh: abc.txt: not found -resource(%d) of type (stream) - -Warning: Wrong parameter count for pclose() in %s on line %d -NULL - -Warning: Wrong parameter count for pclose() in %s on line %d -NULL - -Warning: pclose(): supplied argument is not a valid stream resource in %s on line %d -bool(false) - ---- Done --- diff --git a/ext/standard/tests/file/realpath_bug77484.phpt b/ext/standard/tests/file/realpath_bug77484.phpt index 9aa3a335c2a96..0b78a2aad26f6 100644 --- a/ext/standard/tests/file/realpath_bug77484.phpt +++ b/ext/standard/tests/file/realpath_bug77484.phpt @@ -2,8 +2,8 @@ Bug #77484 Zend engine crashes when calling realpath in invalid working dir --SKIPIF-- --FILE-- diff --git a/ext/standard/tests/general_functions/proc_nice_basic.phpt b/ext/standard/tests/general_functions/proc_nice_basic.phpt index 9e73a7f890b15..107f6d1865146 100644 --- a/ext/standard/tests/general_functions/proc_nice_basic.phpt +++ b/ext/standard/tests/general_functions/proc_nice_basic.phpt @@ -9,6 +9,7 @@ Simone Gentili (sensorario@gmail.com) --FILE-- diff --git a/ext/standard/tests/network/syslog_new_line.phpt b/ext/standard/tests/network/syslog_new_line.phpt index 69eb9c1d67e7e..d63f5714c79c2 100644 --- a/ext/standard/tests/network/syslog_new_line.phpt +++ b/ext/standard/tests/network/syslog_new_line.phpt @@ -4,6 +4,8 @@ Test syslog() function : new line in message --FILE-- --FILE-- --EXPECTF-- -Notice: stream_get_contents(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: stream_get_contents(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d string(0) "" -Notice: stream_get_contents(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: stream_get_contents(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d string(0) "" -Notice: stream_get_contents(): Read of 8192 bytes failed with errno=9 Bad file descriptor in %s on line %d +Notice: stream_get_contents(): Read of 8192 bytes failed with errno=9 Bad file %r(descriptor|number)%r in %s on line %d string(0) "" diff --git a/ext/standard/tests/streams/gh9590-001.phpt b/ext/standard/tests/streams/gh9590-001.phpt index 558e4660a65f8..8f5691af1adea 100644 --- a/ext/standard/tests/streams/gh9590-001.phpt +++ b/ext/standard/tests/streams/gh9590-001.phpt @@ -7,6 +7,8 @@ posix if (!function_exists('posix_setrlimit') || !posix_setrlimit(POSIX_RLIMIT_NOFILE, 2048, -1)) { die('skip Failed to set POSIX_RLIMIT_NOFILE'); } +if (PHP_OS_FAMILY === 'Solaris' && PHP_INT_SIZE === 8) + die('skip Solaris LP64 FD_SETSIZE=65536 not practically exceedable here'); ?> --FILE-- --FILE-- "USD", - "en_AU.utf8" => "AUD", - "ko_KR.utf8" => "KRW", - "zh_CN.utf8" => "CNY", - "de_DE.utf8" => "EUR", - "es_EC.utf8" => "USD", - "fr_FR.utf8" => "EUR", - "ja_JP.utf8" => "JPY", - "el_GR.utf8" => "EUR", - "nl_NL.utf8" =>"EUR" + "en_US.$utfending" => "USD", + "en_AU.$utfending" => "AUD", + "ko_KR.$utfending" => "KRW", + "zh_CN.$utfending" => "CNY", + "de_DE.$utfending" => "EUR", + "es_EC.$utfending" => "USD", + "fr_FR.$utfending" => "EUR", + "ja_JP.$utfending" => "JPY", + "el_GR.$utfending" => "EUR", + "nl_NL.$utfending" =>"EUR" ); // gather all the locales installed in the system $all_system_locales = list_system_locales(); // Now check for three locales that is present in the system and use that as argument to setlocale() -if( in_array("en_US.utf8",$all_system_locales) || - in_array("Ko_KR.utf8",$all_system_locales) || - in_array("zh_CN.utf8",$all_system_locales) ) { +if( in_array("en_US.$utfending",$all_system_locales) || + in_array("Ko_KR.$utfending",$all_system_locales) || + in_array("zh_CN.$utfending",$all_system_locales) ) { echo "-- Testing setlocale() by giving 'category' as LC_ALL & multiple locales(en_US.utf8, Ko_KR.utf8, zh_CN.utf8) --\n"; // call setlocale() - $new_locale = setlocale(LC_ALL, "en_US.utf8", "Ko_KR.utf8", "zh_CN.utf8"); + $new_locale = setlocale(LC_ALL, "en_US.$utfending", "Ko_KR.$utfending", "zh_CN.$utfending"); // dump the name of the new locale set by setlocale() var_dump($new_locale); diff --git a/ext/standard/tests/strings/setlocale_variation1.phpt b/ext/standard/tests/strings/setlocale_variation1.phpt index 4f81fca7c461c..c3709a8cfcff7 100644 --- a/ext/standard/tests/strings/setlocale_variation1.phpt +++ b/ext/standard/tests/strings/setlocale_variation1.phpt @@ -37,31 +37,37 @@ function list_system_locales() { pass as argument to setlocale(), pass 2 invalid arguments along with two valid arguments*/ echo "*** Testing setlocale() by passing multiple valid/invalid locales as argument ***\n"; +if (PHP_OS_FAMILY === 'Solaris') { + $utfending = "UTF-8"; +} else { + $utfending = "utf8"; +} + //set of currency symbol according to above list of locales $currency_symbol = array( - "en_US.utf8" => "USD", - "en_AU.utf8" => "AUD", - "ko_KR.utf8" => "KRW", - "zh_CN.utf8" => "CNY", - "de_DE.utf8" => "EUR", - "es_EC.utf8" => "USD", - "fr_FR.utf8" => "EUR", - "ja_JP.utf8" => "JPY", - "el_GR.utf8" => "EUR", - "nl_NL.utf8" =>"EUR" + "en_US.$utfending" => "USD", + "en_AU.$utfending" => "AUD", + "ko_KR.$utfending" => "KRW", + "zh_CN.$utfending" => "CNY", + "de_DE.$utfending" => "EUR", + "es_EC.$utfending" => "USD", + "fr_FR.$utfending" => "EUR", + "ja_JP.$utfending" => "JPY", + "el_GR.$utfending" => "EUR", + "nl_NL.$utfending" =>"EUR" ); // gather all the locales installed in the system $all_system_locales = list_system_locales(); // Now check for three locales that is present in the system and use that as argument to setlocale() -if( in_array("en_US.utf8",$all_system_locales) || - in_array("Ko_KR.utf8",$all_system_locales) || - in_array("zh_CN.utf8",$all_system_locales) ) { +if( in_array("en_US.$utfending",$all_system_locales) || + in_array("Ko_KR.$utfending",$all_system_locales) || + in_array("zh_CN.$utfending",$all_system_locales) ) { echo "-- Testing setlocale() by giving 'category' as LC_ALL & multiple locales(en_US.invalid, en_US.utf8, Ko_KR.utf8, KO_KR.invalid, zh_CN.utf8) --\n"; // call setlocale() - $new_locale = setlocale(LC_ALL, "en_US.invalid", "en_US.utf8", "Ko_KR.utf8", "KO_KR.invalid", "zh_CN.utf8"); + $new_locale = setlocale(LC_ALL, "en_US.invalid", "en_US.$utfending", "Ko_KR.$utfending", "KO_KR.invalid", "zh_CN.$utfending"); // dump the name of the new locale set by setlocale() var_dump($new_locale); diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt index 6f62f71ac1f26..c6d44c4a54c2f 100644 --- a/ext/standard/tests/strings/setlocale_variation2.phpt +++ b/ext/standard/tests/strings/setlocale_variation2.phpt @@ -5,6 +5,9 @@ Test setlocale() function : usage variations - Setting all available locales in if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip Not valid for windows'); } +if (PHP_OS_FAMILY === 'Solaris') { + die("skip Some locales on Solaris (e.g. iso_8859_1) are incomplete, cannot test LC_ALL"); +} exec("locale -a", $output, $exit_code); if ($exit_code !== 0) { die("skip locale -a not available"); diff --git a/ext/standard/tests/time/strptime_basic.phpt b/ext/standard/tests/time/strptime_basic.phpt index 17008e97d81c0..cbb713471349f 100644 --- a/ext/standard/tests/time/strptime_basic.phpt +++ b/ext/standard/tests/time/strptime_basic.phpt @@ -5,8 +5,8 @@ Test strptime() function : basic functionality if (!function_exists('strptime')) { die("skip - strptime() function not available in this build"); } -if (PHP_OS_FAMILY == 'Darwin' || PHP_OS_FAMILY == 'BSD') { - die("skip strptime() behaves differently on Darwin/BSD"); +if (PHP_OS_FAMILY == 'Darwin' || PHP_OS_FAMILY == 'BSD' || PHP_OS_FAMILY == 'Solaris' ) { + die("skip strptime() behaves differently on Darwin/BSD/Solaris"); } if (!@strftime('%Z')) die('skip strftime does not support %Z'); ?> diff --git a/ext/xsl/tests/maxTemplateVars_modification_validation_bypass.phpt b/ext/xsl/tests/maxTemplateVars_modification_validation_bypass.phpt index d2e52aa6099ba..7d95f7c02bade 100644 --- a/ext/xsl/tests/maxTemplateVars_modification_validation_bypass.phpt +++ b/ext/xsl/tests/maxTemplateVars_modification_validation_bypass.phpt @@ -36,7 +36,7 @@ echo "--- Dump ---\n"; var_dump($proc); ?> ---EXPECT-- +--EXPECTF-- --- Set to 1 --- --- Set to -1 --- XSLTProcessor::$maxTemplateVars must be greater than or equal to 0 @@ -51,7 +51,7 @@ object(XSLTProcessor)#1 (4) { ["cloneDocument"]=> bool(false) ["maxTemplateDepth"]=> - int(3000) + int(%d) ["maxTemplateVars"]=> int(1) } diff --git a/ext/zend_test/tests/gh11078.phpt b/ext/zend_test/tests/gh11078.phpt index 5279d703b2733..2aed49480b021 100644 --- a/ext/zend_test/tests/gh11078.phpt +++ b/ext/zend_test/tests/gh11078.phpt @@ -6,6 +6,7 @@ zend_test --FILE-- --EXTENSIONS-- zlib --FILE-- diff --git a/sapi/cli/tests/cli_process_title_unix.phpt b/sapi/cli/tests/cli_process_title_unix.phpt index 166cb79ad3a67..9f4d5ba6ce5e1 100644 --- a/sapi/cli/tests/cli_process_title_unix.phpt +++ b/sapi/cli/tests/cli_process_title_unix.phpt @@ -13,6 +13,9 @@ exec("ps -p 1", $output, $exit_code); if ($exit_code !== 0) { die("skip ps -p is not available"); } +if (PHP_OS_FAMILY === 'Solaris') { + die("skip process titles not supported on Solaris"); +} ?> --FILE-- Date: Wed, 4 Mar 2026 12:55:58 +0100 Subject: [PATCH 3/4] Fix incorrect zend_hash_find_ptr() on non-ptr in ReflectionProperty::isReadable() (GH-21339) Fixes OSS-Fuzz #489355368 --- ext/reflection/php_reflection.c | 4 ++-- ext/reflection/tests/oss-fuzz-489355368.phpt | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 ext/reflection/tests/oss-fuzz-489355368.phpt diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 2a9b4776350bc..587bca11522b2 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -6676,7 +6676,7 @@ ZEND_METHOD(ReflectionProperty, isReadable) zend_class_entry *ce = obj ? obj->ce : intern->ce; if (!prop) { - if (obj && obj->properties && zend_hash_find_ptr(obj->properties, ref->unmangled_name)) { + if (obj && obj->properties && zend_hash_find(obj->properties, ref->unmangled_name)) { RETURN_TRUE; } handle_magic_get: @@ -6701,7 +6701,7 @@ ZEND_METHOD(ReflectionProperty, isReadable) if (!obj) { RETURN_THROWS(); } - if (obj->properties && zend_hash_find_ptr(obj->properties, ref->unmangled_name)) { + if (obj->properties && zend_hash_find(obj->properties, ref->unmangled_name)) { RETURN_TRUE; } } diff --git a/ext/reflection/tests/oss-fuzz-489355368.phpt b/ext/reflection/tests/oss-fuzz-489355368.phpt new file mode 100644 index 0000000000000..1885f33476d4a --- /dev/null +++ b/ext/reflection/tests/oss-fuzz-489355368.phpt @@ -0,0 +1,17 @@ +--TEST-- +OSS-Fuzz #489355368: Incorrect assumption Z_PTR_P assumption +--FILE-- +prop = 0; + +$rp = new ReflectionProperty($obj, 'prop'); +var_dump($rp->isReadable(null, $obj)); + +?> +--EXPECT-- +bool(true) From 11a95749b1c10ef9ef2ff19a2f27739673ca9883 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois <2144837+alexandre-daubois@users.noreply.github.com> Date: Wed, 4 Mar 2026 14:07:46 +0100 Subject: [PATCH 4/4] Convert more zend_parse_parameters_none() to fast ZPP (#21330) --- ext/com_dotnet/com_com.c | 4 +-- ext/com_dotnet/com_persist.c | 12 +++------ ext/dba/dba.c | 4 +-- ext/dom/document.c | 12 +++------ ext/dom/documentfragment.c | 4 +-- ext/dom/element.c | 4 +-- ext/enchant/enchant.c | 4 +-- ext/filter/filter.c | 4 +-- ext/hash/hash.c | 16 +++--------- ext/mbstring/php_mbregex.c | 8 ++---- ext/mysqli/mysqli.c | 4 +-- ext/mysqli/mysqli_api.c | 12 +++------ ext/mysqli/mysqli_nonapi.c | 16 +++--------- ext/mysqli/mysqli_warning.c | 4 +-- ext/odbc/php_odbc.c | 4 +-- ext/opcache/zend_accelerator_module.c | 8 ++---- ext/openssl/openssl.c | 12 +++------ ext/pdo_firebird/pdo_firebird.c | 4 +-- ext/readline/readline.c | 24 +++++------------- ext/session/mod_user_class.c | 4 +-- ext/session/session.c | 36 +++++++-------------------- ext/sqlite3/sqlite3.c | 28 ++++++--------------- ext/standard/http.c | 8 ++---- ext/xmlwriter/php_xmlwriter.c | 4 +-- ext/xsl/xsltprocessor.c | 8 ++---- ext/zlib/zlib.c | 4 +-- sapi/apache2handler/php_functions.c | 8 ++---- sapi/cgi/cgi_main.c | 4 +-- sapi/cli/php_cli_process_title.c | 4 +-- sapi/cli/php_cli_server.c | 8 ++---- sapi/fpm/fpm/fpm_main.c | 12 +++------ sapi/litespeed/lsapi_main.c | 16 +++--------- sapi/phpdbg/phpdbg.c | 12 +++------ win32/codepage.c | 4 +-- 34 files changed, 80 insertions(+), 240 deletions(-) diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 129db275a72ef..1b8c8a082a05d 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -658,9 +658,7 @@ PHP_FUNCTION(com_create_guid) GUID retval; OLECHAR *guid_string; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); php_com_initialize(); if (CoCreateGuid(&retval) == S_OK && StringFromCLSID(&retval, &guid_string) == S_OK) { diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c index 742e007a2fba7..1b89aea15e233 100644 --- a/ext/com_dotnet/com_persist.c +++ b/ext/com_dotnet/com_persist.c @@ -319,9 +319,7 @@ CPH_METHOD(GetCurFileName) OLECHAR *olename = NULL; CPH_FETCH(); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CPH_NO_OBJ(); @@ -457,9 +455,7 @@ CPH_METHOD(GetMaxStreamSize) ULARGE_INTEGER size; CPH_FETCH(); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CPH_NO_OBJ(); @@ -491,9 +487,7 @@ CPH_METHOD(InitNew) HRESULT res; CPH_FETCH(); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); CPH_NO_OBJ(); diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 8963230353299..fb6017fbab88d 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -1301,9 +1301,7 @@ PHP_FUNCTION(dba_handlers) /* {{{ List opened databases */ PHP_FUNCTION(dba_list) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); diff --git a/ext/dom/document.c b/ext/dom/document.c index b46722d854c5e..9d7213a64df20 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -502,9 +502,7 @@ PHP_METHOD(DOMDocument, createDocumentFragment) dom_object *intern; id = ZEND_THIS; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -1251,9 +1249,7 @@ PHP_METHOD(DOMDocument, normalizeDocument) dom_object *intern; id = ZEND_THIS; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); DOM_GET_OBJ(docp, id, xmlDocPtr, intern); @@ -1818,9 +1814,7 @@ PHP_METHOD(DOMDocument, validate) xmlValidCtxt *cvp; id = ZEND_THIS; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); DOM_GET_OBJ(docp, id, xmlDocPtr, intern); diff --git a/ext/dom/documentfragment.c b/ext/dom/documentfragment.c index 76870faedfa4c..65538b711f2da 100644 --- a/ext/dom/documentfragment.c +++ b/ext/dom/documentfragment.c @@ -36,9 +36,7 @@ PHP_METHOD(DOMDocumentFragment, __construct) xmlNodePtr nodep = NULL, oldnode = NULL; dom_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); nodep = xmlNewDocFragment(NULL); diff --git a/ext/dom/element.c b/ext/dom/element.c index 9d70390275cef..4d0099b2c6410 100644 --- a/ext/dom/element.c +++ b/ext/dom/element.c @@ -1477,9 +1477,7 @@ PHP_METHOD(DOMElement, remove) { dom_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); DOM_GET_THIS_INTERN(intern); diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index 534908f9d1cc5..43547ab9b5dc7 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -264,9 +264,7 @@ PHP_FUNCTION(enchant_broker_init) enchant_broker *broker; EnchantBroker *pbroker; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); pbroker = enchant_broker_init(); if (pbroker) { diff --git a/ext/filter/filter.c b/ext/filter/filter.c index 70ab5d358f2c4..03f0f7887f924 100644 --- a/ext/filter/filter.c +++ b/ext/filter/filter.c @@ -825,9 +825,7 @@ PHP_FUNCTION(filter_list) { int size = sizeof(filter_list) / sizeof(filter_list_entry); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); for (int i = 0; i < size; ++i) { diff --git a/ext/hash/hash.c b/ext/hash/hash.c index d255711efbed9..8a9494fb62d01 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -858,9 +858,7 @@ PHP_FUNCTION(hash_algos) { zend_string *str; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); ZEND_HASH_MAP_FOREACH_STR_KEY(&php_hash_hashtable, str) { @@ -875,9 +873,7 @@ PHP_FUNCTION(hash_hmac_algos) zend_string *str; const php_hash_ops *ops; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(&php_hash_hashtable, str, ops) { @@ -1260,9 +1256,7 @@ PHP_FUNCTION(mhash_get_hash_name) /* {{{ Gets the number of available hashes */ PHP_FUNCTION(mhash_count) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(MHASH_NUM_ALGOS - 1); } /* }}} */ @@ -1463,9 +1457,7 @@ PHP_METHOD(HashContext, __serialize) zend_long magic = 0; zval tmp; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 5831ce2a5a699..a819def4b5bd5 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -1506,9 +1506,7 @@ PHP_FUNCTION(mb_ereg_search_getregs) int beg, end; OnigUChar *str; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (MBREX(search_regs) != NULL && Z_TYPE(MBREX(search_str)) == IS_STRING) { array_init(return_value); @@ -1544,9 +1542,7 @@ PHP_FUNCTION(mb_ereg_search_getregs) /* {{{ Get search start position */ PHP_FUNCTION(mb_ereg_search_getpos) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETVAL_LONG(MBREX(search_pos)); } diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index b171986d29cef..caefd9432d147 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -723,9 +723,7 @@ PHP_METHOD(mysqli_result, __construct) PHP_METHOD(mysqli_result, getIterator) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); zend_create_internal_iterator_zval(return_value, ZEND_THIS); } diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 7af90f6658543..9473f4a06c135 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -856,9 +856,7 @@ PHP_FUNCTION(mysqli_free_result) PHP_FUNCTION(mysqli_get_client_info) { if (hasThis()) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); } else { zval *mysql_link; @@ -878,9 +876,7 @@ PHP_FUNCTION(mysqli_get_client_info) /* {{{ Get MySQL client info */ PHP_FUNCTION(mysqli_get_client_version) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG((zend_long)mysql_get_client_version()); } @@ -1946,9 +1942,7 @@ PHP_FUNCTION(mysqli_thread_id) /* {{{ Return whether thread safety is given or not */ PHP_FUNCTION(mysqli_thread_safe) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(mysql_thread_safe()); } diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index a3208b41574b1..50c9b36e4cecb 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -343,9 +343,7 @@ PHP_METHOD(mysqli, init) /* {{{ Returns the numerical value of the error message from last connect command */ PHP_FUNCTION(mysqli_connect_errno) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(MyG(error_no)); } @@ -354,9 +352,7 @@ PHP_FUNCTION(mysqli_connect_errno) /* {{{ Returns the text of the error message from previous MySQL operation */ PHP_FUNCTION(mysqli_connect_error) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (MyG(error_msg)) { RETURN_STRING(MyG(error_msg)); @@ -448,9 +444,7 @@ PHP_FUNCTION(mysqli_fetch_all) /* {{{ Returns statistics about the zval cache */ PHP_FUNCTION(mysqli_get_client_stats) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); mysqlnd_get_client_stats(return_value); } /* }}} */ @@ -1088,9 +1082,7 @@ PHP_FUNCTION(mysqli_release_savepoint) /* {{{ Returns information about open and cached links */ PHP_FUNCTION(mysqli_get_links_stats) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); add_assoc_long_ex(return_value, "total", sizeof("total") - 1, MyG(num_links)); diff --git a/ext/mysqli/mysqli_warning.c b/ext/mysqli/mysqli_warning.c index 4b0792b9684b8..0bb730ef6cf62 100644 --- a/ext/mysqli/mysqli_warning.c +++ b/ext/mysqli/mysqli_warning.c @@ -120,9 +120,7 @@ PHP_METHOD(mysqli_warning, next) MYSQLI_WARNING *w; mysqli_object *obj = Z_MYSQLI_P(ZEND_THIS); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (obj->ptr) { MYSQLI_FETCH_RESOURCE(w, MYSQLI_WARNING *, ZEND_THIS, MYSQLI_STATUS_VALID); diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index a6af7469cbac3..7eec40aa656ff 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -823,9 +823,7 @@ PHP_FUNCTION(odbc_close_all) { zval *zv; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); /* Loop through the link list, now close all links and their results */ ZEND_HASH_FOREACH_VAL(&ODBCG(connections), zv) { diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index befbb621f4c25..1eaa183f9df5b 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -801,9 +801,7 @@ ZEND_FUNCTION(opcache_get_configuration) { zval directives, version, blacklist; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (!validate_api_restriction()) { RETURN_FALSE; @@ -908,9 +906,7 @@ ZEND_FUNCTION(opcache_get_configuration) /* {{{ Request that the contents of the opcode cache to be reset */ ZEND_FUNCTION(opcache_reset) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (!validate_api_restriction()) { RETURN_FALSE; diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 9e39e2ad3e736..1ec9ec85729a5 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -522,9 +522,7 @@ PHP_MSHUTDOWN_FUNCTION(openssl) /* {{{ Retrieve an array mapping available certificate locations */ PHP_FUNCTION(openssl_get_cert_locations) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); php_openssl_set_cert_locations(return_value); @@ -4024,9 +4022,7 @@ PHP_FUNCTION(openssl_error_string) char buf[256]; unsigned long val; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); php_openssl_store_errors(); @@ -4444,9 +4440,7 @@ PHP_FUNCTION(openssl_get_curve_names) size_t i; size_t len = EC_get_builtin_curves(NULL, 0); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); curves = emalloc(sizeof(EC_builtin_curve) * len); if (!EC_get_builtin_curves(curves, len)) { diff --git a/ext/pdo_firebird/pdo_firebird.c b/ext/pdo_firebird/pdo_firebird.c index abc43dd3ad587..ece55926b0f47 100644 --- a/ext/pdo_firebird/pdo_firebird.c +++ b/ext/pdo_firebird/pdo_firebird.c @@ -106,9 +106,7 @@ PHP_MINFO_FUNCTION(pdo_firebird) /* {{{ */ PHP_METHOD(Pdo_Firebird, getApiVersion) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(FB_API_VER); } diff --git a/ext/readline/readline.c b/ext/readline/readline.c index dad6a726f1bff..b9671ac1caa04 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -309,9 +309,7 @@ PHP_FUNCTION(readline_add_history) /* {{{ Clears the history */ PHP_FUNCTION(readline_clear_history) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); #ifdef HAVE_LIBEDIT /* clear_history is the only function where rl_initialize @@ -331,9 +329,7 @@ PHP_FUNCTION(readline_list_history) { HIST_ENTRY **history; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -546,9 +542,7 @@ PHP_FUNCTION(readline_callback_handler_install) /* {{{ Informs the readline callback interface that a character is ready for input */ PHP_FUNCTION(readline_callback_read_char) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (Z_TYPE(_prepped_callback) != IS_UNDEF) { rl_callback_read_char(); @@ -559,9 +553,7 @@ PHP_FUNCTION(readline_callback_read_char) /* {{{ Removes a previously installed callback handler and restores terminal settings */ PHP_FUNCTION(readline_callback_handler_remove) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (Z_TYPE(_prepped_callback) != IS_UNDEF) { rl_callback_handler_remove(); @@ -576,9 +568,7 @@ PHP_FUNCTION(readline_callback_handler_remove) /* {{{ Ask readline to redraw the display */ PHP_FUNCTION(readline_redisplay) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); #ifdef HAVE_LIBEDIT /* seems libedit doesn't take care of rl_initialize in rl_redisplay @@ -595,9 +585,7 @@ PHP_FUNCTION(readline_redisplay) /* {{{ Inform readline that the cursor has moved to a new line */ PHP_FUNCTION(readline_on_new_line) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); rl_on_new_line(); } diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c index 618cc6bd67965..eb5a47b19cee6 100644 --- a/ext/session/mod_user_class.c +++ b/ext/session/mod_user_class.c @@ -146,9 +146,7 @@ PHP_METHOD(SessionHandler, create_sid) { zend_string *id; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); PS_SANITY_CHECK; diff --git a/ext/session/session.c b/ext/session/session.c index 02977d8d6115c..e790fa074d606 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1923,9 +1923,7 @@ PHP_FUNCTION(session_set_cookie_params) PHP_FUNCTION(session_get_cookie_params) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -2509,9 +2507,7 @@ PHP_FUNCTION(session_encode) { zend_string *enc; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); enc = php_session_encode(); if (enc == NULL) { @@ -2638,18 +2634,14 @@ PHP_FUNCTION(session_start) PHP_FUNCTION(session_destroy) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(php_session_destroy() == SUCCESS); } PHP_FUNCTION(session_unset) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (PS(session_status) != php_session_active) { RETURN_FALSE; @@ -2669,9 +2661,7 @@ PHP_FUNCTION(session_gc) { zend_long num; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (PS(session_status) != php_session_active) { php_error_docref(NULL, E_WARNING, "Session cannot be garbage collected when there is no active session"); @@ -2689,9 +2679,7 @@ PHP_FUNCTION(session_gc) PHP_FUNCTION(session_write_close) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(php_session_flush(true)); } @@ -2699,9 +2687,7 @@ PHP_FUNCTION(session_write_close) /* Abort session and end session. Session data will not be written */ PHP_FUNCTION(session_abort) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(php_session_abort()); } @@ -2709,18 +2695,14 @@ PHP_FUNCTION(session_abort) /* Reset session data from saved session data */ PHP_FUNCTION(session_reset) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(php_session_reset()); } PHP_FUNCTION(session_status) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_LONG(PS(session_status)); } diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 3d41b2c2c2240..659de2291d86d 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -186,9 +186,7 @@ PHP_METHOD(SQLite3, close) int errcode; db_obj = Z_SQLITE3_DB_P(object); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (db_obj->initialised) { zend_llist_clean(&(db_obj->free_list)); @@ -237,9 +235,7 @@ PHP_METHOD(SQLite3, exec) /* {{{ Returns the SQLite3 Library version as a string constant and as a number. */ PHP_METHOD(SQLite3, version) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -257,9 +253,7 @@ PHP_METHOD(SQLite3, lastInsertRowID) zval *object = ZEND_THIS; db_obj = Z_SQLITE3_DB_P(object); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3) @@ -274,9 +268,7 @@ PHP_METHOD(SQLite3, lastErrorCode) zval *object = ZEND_THIS; db_obj = Z_SQLITE3_DB_P(object); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->db, SQLite3) @@ -295,9 +287,7 @@ PHP_METHOD(SQLite3, lastExtendedErrorCode) zval *object = ZEND_THIS; db_obj = Z_SQLITE3_DB_P(object); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->db, SQLite3) @@ -343,9 +333,7 @@ PHP_METHOD(SQLite3, lastErrorMsg) zval *object = ZEND_THIS; db_obj = Z_SQLITE3_DB_P(object); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->db, SQLite3) @@ -469,9 +457,7 @@ PHP_METHOD(SQLite3, changes) zval *object = ZEND_THIS; db_obj = Z_SQLITE3_DB_P(object); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); SQLITE3_CHECK_INITIALIZED(db_obj, db_obj->initialised, SQLite3) diff --git a/ext/standard/http.c b/ext/standard/http.c index 47443f74ffe98..9ce8d5e559a7d 100644 --- a/ext/standard/http.c +++ b/ext/standard/http.c @@ -374,9 +374,7 @@ PHP_FUNCTION(request_parse_body) PHP_FUNCTION(http_get_last_response_headers) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (!Z_ISUNDEF(BG(last_http_headers))) { RETURN_COPY(&BG(last_http_headers)); @@ -387,9 +385,7 @@ PHP_FUNCTION(http_get_last_response_headers) PHP_FUNCTION(http_clear_last_response_headers) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); zval_ptr_dtor(&BG(last_http_headers)); ZVAL_UNDEF(&BG(last_http_headers)); diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index 6d711e89b89d4..0c65305c6827d 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -907,9 +907,7 @@ PHP_FUNCTION(xmlwriter_open_memory) zval *self = getThis(); ze_xmlwriter_object *ze_obj = NULL; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (self) { /* We do not use XMLWRITER_FROM_OBJECT, xmlwriter init function here */ diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c index 7e184421aeeb4..18b1edaf37a18 100644 --- a/ext/xsl/xsltprocessor.c +++ b/ext/xsl/xsltprocessor.c @@ -814,9 +814,7 @@ PHP_METHOD(XSLTProcessor, getSecurityPrefs) zval *id = ZEND_THIS; xsl_object *intern; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); intern = Z_XSL_P(id); @@ -827,9 +825,7 @@ PHP_METHOD(XSLTProcessor, getSecurityPrefs) /* {{{ */ PHP_METHOD(XSLTProcessor, hasExsltSupport) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); #ifdef HAVE_XSL_EXSLT RETURN_TRUE; diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 4a6bb81899c91..d5a89768ff627 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -588,9 +588,7 @@ PHP_FUNCTION(ob_gzhandler) /* {{{ Returns the coding type used for output compression */ PHP_FUNCTION(zlib_get_coding_type) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); switch (ZLIBG(compression_coding)) { case PHP_ZLIB_ENCODING_GZIP: RETURN_STRINGL("gzip", sizeof("gzip") - 1); diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c index 9b073207c8198..c2b15af86a601 100644 --- a/sapi/apache2handler/php_functions.c +++ b/sapi/apache2handler/php_functions.c @@ -172,9 +172,7 @@ PHP_FUNCTION(apache_request_headers) const apr_array_header_t *arr; char *key, *val; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -195,9 +193,7 @@ PHP_FUNCTION(apache_response_headers) const apr_array_header_t *arr; char *key, *val; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 3decc673389b3..213870db54f1e 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1687,9 +1687,7 @@ static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{ PHP_FUNCTION(apache_response_headers) /* {{{ */ { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value); diff --git a/sapi/cli/php_cli_process_title.c b/sapi/cli/php_cli_process_title.c index a786de2b46594..fe36c9a2fdbcb 100644 --- a/sapi/cli/php_cli_process_title.c +++ b/sapi/cli/php_cli_process_title.c @@ -48,9 +48,7 @@ PHP_FUNCTION(cli_get_process_title) size_t length = 0; const char* title = NULL; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); ps_title_status rc = get_ps_title(&length, &title); if (rc != PS_TITLE_SUCCESS) { diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index bab7ad011e07d..65d6d5a898de3 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -401,9 +401,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */ { php_cli_server_client *client; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); client = SG(server_context); @@ -442,9 +440,7 @@ static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{ PHP_FUNCTION(apache_response_headers) /* {{{ */ { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); zend_llist_apply_with_argument(&SG(sapi_headers).headers, (llist_apply_with_arg_func_t)add_response_header, return_value); diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c index f1f7de70b279b..83b00eb4c4d30 100644 --- a/sapi/fpm/fpm/fpm_main.c +++ b/sapi/fpm/fpm/fpm_main.c @@ -1492,9 +1492,7 @@ PHP_FUNCTION(fastcgi_finish_request) /* {{{ */ { fcgi_request *request = (fcgi_request*) SG(server_context); - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (!fcgi_is_closed(request)) { php_output_end_all(); @@ -1514,9 +1512,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */ { fcgi_request *request; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); if ((request = (fcgi_request*) SG(server_context))) { @@ -1527,9 +1523,7 @@ PHP_FUNCTION(apache_request_headers) /* {{{ */ /* {{{ Returns the status of the fastcgi process manager */ PHP_FUNCTION(fpm_get_status) /* {{{ */ { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (fpm_status_export_to_zval(return_value)) { RETURN_FALSE; diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index 75dc721240e69..dea92b8b83cf7 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -1658,9 +1658,7 @@ static int add_associate_array( const char * pKey, int keyLen, const char * pVal /* {{{ Fetch all HTTP request headers */ PHP_FUNCTION(litespeed_request_headers) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); @@ -1679,9 +1677,7 @@ PHP_FUNCTION(litespeed_response_headers) int len; char headerBuf[SAPI_LSAPI_MAX_HEADER_LENGTH]; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); if (!zend_llist_count(&SG(sapi_headers).headers)) { RETURN_FALSE; @@ -1721,9 +1717,7 @@ PHP_FUNCTION(apache_get_modules) }; const char **name = mod_names; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); array_init(return_value); while( *name ) @@ -1738,9 +1732,7 @@ PHP_FUNCTION(apache_get_modules) /* {{{ Flushes all response data to the client */ PHP_FUNCTION(litespeed_finish_request) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); php_output_end_all(); php_header(); diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 4ef83be1b9f47..4227acae4f19d 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -288,9 +288,7 @@ PHP_FUNCTION(phpdbg_break_next) { zend_execute_data *ex; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); ex = EG(current_execute_data); while (ex && ex->func && !ZEND_USER_CODE(ex->func->type)) { @@ -347,9 +345,7 @@ PHP_FUNCTION(phpdbg_break_function) /* {{{ instructs phpdbg to clear breakpoints */ PHP_FUNCTION(phpdbg_clear) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE]); zend_hash_clean(&PHPDBG_G(bp)[PHPDBG_BREAK_FILE_PENDING]); @@ -404,9 +400,7 @@ PHP_FUNCTION(phpdbg_start_oplog) { phpdbg_oplog_list *prev; - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); prev = PHPDBG_G(oplog_list); diff --git a/win32/codepage.c b/win32/codepage.c index e038a9fbd4140..b8c2301fb7089 100644 --- a/win32/codepage.c +++ b/win32/codepage.c @@ -646,9 +646,7 @@ PHP_FUNCTION(sapi_windows_cp_get) /* {{{ Indicates whether the codepage is UTF-8 compatible. */ PHP_FUNCTION(sapi_windows_cp_is_utf8) { - if (zend_parse_parameters_none() == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_NONE(); RETURN_BOOL(php_win32_cp_use_unicode()); }