mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-11 03:00:49 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f491838d8 | ||
|
|
097dc16bf3 |
No files matched your search
@@ -11,7 +11,9 @@ end
|
||||
|
||||
define ____executor_globals
|
||||
if basic_functions_module.zts
|
||||
set $tsrm_ls = _tsrm_ls_cache
|
||||
if !$tsrm_ls
|
||||
set $tsrm_ls = ts_resource_ex(0, 0)
|
||||
end
|
||||
set $eg = ((zend_executor_globals*) (*((void ***) $tsrm_ls))[executor_globals_id-1])
|
||||
set $cg = ((zend_compiler_globals*) (*((void ***) $tsrm_ls))[compiler_globals_id-1])
|
||||
set $eg_ptr = $eg
|
||||
@@ -350,8 +352,7 @@ define ____print_ht
|
||||
end
|
||||
printf "[%d] ", $i
|
||||
if $p->key
|
||||
____print_str $p->key->val $p->key->len
|
||||
printf " => "
|
||||
printf "%s => ", $p->key->val
|
||||
else
|
||||
printf "%d => ", $p->h
|
||||
end
|
||||
|
||||
+1
-7
@@ -27,7 +27,6 @@ addons:
|
||||
- libpspell-dev
|
||||
- libsasl2-dev
|
||||
- libsqlite3-dev
|
||||
- libsodium-dev
|
||||
- libtidy-dev
|
||||
- libwebp-dev
|
||||
- libxml2-dev
|
||||
@@ -70,13 +69,10 @@ jobs:
|
||||
include:
|
||||
- env: ENABLE_MAINTAINER_ZTS=0 ENABLE_DEBUG=0
|
||||
arch: amd64
|
||||
if: type = cron
|
||||
- env: ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1
|
||||
arch: amd64
|
||||
if: type = cron
|
||||
- env: ENABLE_MAINTAINER_ZTS=1 ENABLE_DEBUG=1 SKIP_IO_CAPTURE_TESTS=1 ARM64=1
|
||||
arch: arm64
|
||||
if: type = cron
|
||||
|
||||
before_script:
|
||||
- ccache --version
|
||||
@@ -92,9 +88,7 @@ before_script:
|
||||
|
||||
# Run PHPs run-tests.php
|
||||
script:
|
||||
# ARM64 CI reports nproc=32, which is excessive.
|
||||
- if [ -z "$ARM64" ]; then export JOBS=$(nproc); else export JOBS=16; fi
|
||||
- ./sapi/cli/php run-tests.php -P -d extension=`pwd`/modules/zend_test.so $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d opcache.protect_memory=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120 -j$JOBS
|
||||
- ./sapi/cli/php run-tests.php -P -d extension=`pwd`/modules/zend_test.so $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d opcache.protect_memory=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120 -j$(nproc)
|
||||
- sapi/cli/php -d extension_dir=`pwd`/modules -r 'dl("zend_test");'
|
||||
|
||||
after_success:
|
||||
|
||||
+6
-6
@@ -35,7 +35,7 @@ If you are fixing a bug, then please submit your PR against the lowest actively
|
||||
supported branch of PHP that the bug affects (only green branches on
|
||||
[the supported version page](https://www.php.net/supported-versions.php) are
|
||||
supported). For example, at the time of writing, the lowest supported version is
|
||||
PHP 7.3, which corresponds to the `PHP-7.3` branch in Git. Please also make sure
|
||||
PHP 7.2, which corresponds to the `PHP-7.2` branch in Git. Please also make sure
|
||||
you add a link to the PR in the bug on [the bug tracker](https://bugs.php.net/).
|
||||
|
||||
Pull requests implementing RFCs should be submitted against `master`.
|
||||
@@ -331,10 +331,10 @@ Currently we have the following branches in use:
|
||||
| Branch | |
|
||||
| --------- | --------- |
|
||||
| master | Active development branch for PHP 8.0, which is open for backwards incompatible changes and major internal API changes. |
|
||||
| PHP-7.4 | Is used to release the PHP 7.4.x series. This is a current stable version and is open for bugfixes only. |
|
||||
| PHP-7.4 | Active development branch for PHP 7.4, which is open for new features and minor internal API changes. |
|
||||
| PHP-7.3 | Is used to release the PHP 7.3.x series. This is a current stable version and is open for bugfixes only. |
|
||||
| PHP-7.2 | Is used to release the PHP 7.2.x series. This is an old stable version and is open for security fixes only. |
|
||||
| PHP-7.1 | This branch is closed. |
|
||||
| PHP-7.2 | Is used to release the PHP 7.2.x series. This is a current stable version and is open for bugfixes only. |
|
||||
| PHP-7.1 | Is used to release the PHP 7.1.x series. This is an old stable version and is open for security fixes only. |
|
||||
| PHP-7.0 | This branch is closed. |
|
||||
| PHP-5.6 | This branch is closed. |
|
||||
| PHP-5.5 | This branch is closed. |
|
||||
@@ -348,8 +348,8 @@ Currently we have the following branches in use:
|
||||
The next few rules are more of a technical nature:
|
||||
|
||||
1. All non-security bugfix changes should first go to the lowest bugfix branch
|
||||
(i.e. 7.3) and then get merged up to all other branches. All security fixes
|
||||
should go to the lowest security fixes branch (i.e 7.2). If a change is not
|
||||
(i.e. 7.2) and then get merged up to all other branches. All security fixes
|
||||
should go to the lowest security fixes branch (i.e 7.1). If a change is not
|
||||
needed for later branches (i.e. fixes for features which were dropped from
|
||||
later branches) an empty merge should be done.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--------------------------------------------------------------------
|
||||
The PHP License, version 3.01
|
||||
Copyright (c) 1999 - 2021 The PHP Group. All rights reserved.
|
||||
Copyright (c) 1999 - 2019 The PHP Group. All rights reserved.
|
||||
--------------------------------------------------------------------
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
||||
@@ -1,991 +1,7 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
03 Jun 2021, PHP 7.4.20
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80929 (Method name corruption related to repeated calls to
|
||||
call_user_func_array). (twosee)
|
||||
. Fixed bug #80960 (opendir() warning wrong info when failed on Windows).
|
||||
(cmb)
|
||||
. Fixed bug #67792 (HTTP Authorization schemes are treated as case-sensitive).
|
||||
(cmb)
|
||||
. Fixed bug #80972 (Memory exhaustion on invalid string offset). (girgias)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #65800 (Events port mechanism). (psumbera)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #80901 (Info leak in ftp extension). (cmb)
|
||||
. Fixed bug #79100 (Wrong FTP error messages). (cmb)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #81032 (GD install is affected by external libgd installation).
|
||||
(Flavio Heleno, cmb)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug #81011 (mb_convert_encoding removes references from arrays). (cmb)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #80460 (ODBC doesn't account for SQL_NO_TOTAL indicator). (cmb)
|
||||
|
||||
- PDO_MySQL:
|
||||
. Fixed bug #81037 (PDO discards error message text from prepared
|
||||
statement). (Kamil Tekiela)
|
||||
|
||||
- PDO_ODBC:
|
||||
. Fixed bug #44643 (bound parameters ignore explicit type definitions). (cmb)
|
||||
|
||||
- pgsql:
|
||||
. Fixed php_pgsql_fd_cast() wrt. php_stream_can_cast(). (cmb)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #80933 (SplFileObject::DROP_NEW_LINE is broken for NUL and CR).
|
||||
(cmb, Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #80900 (switch statement behavior inside function). (twosee)
|
||||
. Fixed bug #81015 (Opcache optimization assumes wrong part of ternary
|
||||
operator in if-condition). (Nikita)
|
||||
|
||||
- XMLReader:
|
||||
. Fixed bug #73246 (XMLReader: encoding length not checked). (cmb)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #80863 (ZipArchive::extractTo() ignores references). (cmb)
|
||||
|
||||
06 May 2021, PHP 7.4.19
|
||||
|
||||
- PDO_pgsql:
|
||||
. Reverted bug fix for #80892 (PDO::PARAM_INT is treated the same as
|
||||
PDO::PARAM_STR). (Matteo)
|
||||
|
||||
|
||||
29 Apr 2021, PHP 7.4.18
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80781 (Error handler that throws ErrorException infinite loop).
|
||||
(Nikita)
|
||||
. Fixed bug #75776 (Flushing streams with compression filter is broken). (cmb)
|
||||
|
||||
- Dba:
|
||||
. Fixed bug #80817 (dba_popen() may cause segfault during RSHUTDOWN). (cmb)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #66783 (UAF when appending DOMDocument to element). (cmb)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #80024 (Duplication of info about inherited socket after pool
|
||||
removing). (Jakub Zelenka)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #80880 (SSL_read on shutdown, ftp/proc_open). (cmb, Jakub
|
||||
Zelenka)
|
||||
|
||||
- Imap:
|
||||
. Fixed bug #80710 (imap_mail_compose() header injection). (cmb, Stas)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #80763 (msgfmt_format() does not accept DateTime references).
|
||||
(cmb)
|
||||
|
||||
- LibXML:
|
||||
. Fixed bug #51903 (simplexml_load_file() doesn't use HTTP headers). (cmb)
|
||||
. Fixed bug #73533 (Invalid memory access in php_libxml_xmlCheckUTF8). (cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #80713 (SegFault when disabling ATTR_EMULATE_PREPARES and
|
||||
MySQL 8.0). (Nikita)
|
||||
. Fixed bug #80837 (Calling stmt_store_result after fetch doesn't throw an
|
||||
error). (Kamil Tekiela)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #80805 (create simple class and get error in opcache.so). (Nikita)
|
||||
. Fixed bug #80950 (Variables become null in if statements). (Nikita)
|
||||
|
||||
- Pcntl:
|
||||
. Fixed bug #79812 (Potential integer overflow in pcntl_exec()). (cmb)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #80866 (preg_split ignores limit flag when pattern with \K has
|
||||
0-width fullstring match). (Kamil Tekiela)
|
||||
|
||||
- PDO_ODBC:
|
||||
. Fixed bug #80783 (PDO ODBC truncates BLOB records at every 256th byte).
|
||||
(cmb)
|
||||
|
||||
- PDO_pgsql:
|
||||
. Fixed bug #80892 (PDO::PARAM_INT is treated the same as PDO::PARAM_STR).
|
||||
(Matteo)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #80757 (Exit code is 0 when could not open file). (Felipe)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #80774 (session_name() problem with backslash). (cmb)
|
||||
. Fixed bug #80889 (Cannot set save handler when save_handler is invalid).
|
||||
(cmb)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #69668 (SOAP special XML characters in namespace URIs not
|
||||
encoded). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #78719 (http wrapper silently ignores long Location headers).
|
||||
(cmb)
|
||||
. Fixed bug #80771 (phpinfo(INFO_CREDITS) displays nothing in CLI). (cmb)
|
||||
. Fixed bug #80838 (HTTP wrapper waits for HTTP 1 response after HTTP 101).
|
||||
(manuelm)
|
||||
. Fixed bug #80915 (Taking a reference to $_SERVER hides its values from
|
||||
phpinfo()). (Rowan Tommins)
|
||||
|
||||
04 Mar 2021, php 7.4.16
|
||||
|
||||
- Core:
|
||||
. Fixed #80706 (mail(): Headers after Bcc headers may be ignored). (cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #78680 (mysqlnd's mysql_clear_password does not transmit
|
||||
null-terminated password). (Daniel Black)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #74779 (x() and y() truncating floats to integers). (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #80682 (opcache doesn't honour pcre.jit option). (Remi)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #80747 (Providing RSA key size < 512 generates key that crash
|
||||
PHP). (Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #75850 (Unclear error message wrt. __halt_compiler() w/o
|
||||
semicolon) (cmb)
|
||||
. Fixed bug #70091 (Phar does not mark UTF-8 filenames in ZIP archives). (cmb)
|
||||
. Fixed bug #53467 (Phar cannot compress large archives). (cmb, lserni)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug#80719 (Iterating after failed ArrayObject::setIteratorClass()
|
||||
causes Segmentation fault). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #80654 (file_get_contents() maxlen fails above (2**31)-1 bytes).
|
||||
(cmb)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #80648 (Fix for bug 79296 should be based on runtime version).
|
||||
(cmb, Remi)
|
||||
|
||||
04 Feb 2021, PHP 7.4.15
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80523 (bogus parse error on >4GB source code). (Nikita)
|
||||
. Fixed bug #80384 (filter buffers entire read until file closed). (Adam
|
||||
Seitz, cmb)
|
||||
|
||||
- Curl:
|
||||
. Fixed bug #80595 (Resetting POSTFIELDS to empty array breaks request). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #80376 (last day of the month causes runway cpu usage. (Derick)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #67983 (mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to
|
||||
interpret bit columns). (Nikita)
|
||||
. Fixed bug #64638 (Fetching resultsets from stored procedure with cursor
|
||||
fails). (Nikita)
|
||||
. Fixed bug #72862 (segfault using prepared statements on stored procedures
|
||||
that use a cursor). (Nikita)
|
||||
. Fixed bug #77935 (Crash in mysqlnd_fetch_stmt_row_cursor when calling an SP
|
||||
with a cursor). (Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #77565 (Incorrect locator detection in ZIP-based phars). (cmb)
|
||||
. Fixed bug #69279 (Compressed ZIP Phar extractTo() creates garbage files).
|
||||
(cmb)
|
||||
|
||||
07 Jan 2021, PHP 7.4.14
|
||||
|
||||
- Core:
|
||||
. Fixed bug #74558 (Can't rebind closure returned by Closure::fromCallable()).
|
||||
(cmb)
|
||||
. Fixed bug #80345 (PHPIZE configuration has outdated PHP_RELEASE_VERSION).
|
||||
(cmb)
|
||||
. Fixed bug #72964 (White space not unfolded for CC/Bcc headers). (cmb)
|
||||
. Fixed bug #80362 (Running dtrace scripts can cause php to crash).
|
||||
(al at coralnet dot name)
|
||||
. Fixed bug #80393 (Build of PHP extension fails due to configuration gap
|
||||
with libtool). (kir dot morozov at gmail dot com)
|
||||
. Fixed bug #80402 (configure filtering out -lpthread). (Nikita)
|
||||
. Fixed bug #77069 (stream filter loses final block of data). (cmb)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #77961 (finfo_open crafted magic parsing SIGABRT). (cmb)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #69625 (FPM returns 200 status on request without
|
||||
SCRIPT_FILENAME env). (Jakub Zelenka)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #80425 (MessageFormatAdapter::getArgTypeList redefined). (Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #80368 (OpenSSL extension fails to build against LibreSSL due to
|
||||
lack of OCB support). (Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #73809 (Phar Zip parse crash - mmap fail). (cmb)
|
||||
. Fixed bug #75102 (`PharData` says invalid checksum for valid tar). (cmb)
|
||||
. Fixed bug #77322 (PharData::addEmptyDir('/') Possible integer overflow).
|
||||
(cmb)
|
||||
|
||||
- PDO MySQL:
|
||||
. Fixed bug #80458 (PDOStatement::fetchAll() throws for upsert queries).
|
||||
(Kamil Tekiela)
|
||||
. Fixed bug #63185 (nextRowset() ignores MySQL errors with native prepared
|
||||
statements). (Nikita)
|
||||
. Fixed bug #78152 (PDO::exec() - Bad error handling with multiple commands).
|
||||
(Nikita)
|
||||
. Fixed bug #70066 (Unexpected "Cannot execute queries while other unbuffered
|
||||
queries"). (Nikita)
|
||||
. Fixed bug #71145 (Multiple statements in init command triggers unbuffered
|
||||
query error). (Nikita)
|
||||
. Fixed bug #76815 (PDOStatement cannot be GCed/closeCursor-ed when a
|
||||
PROCEDURE resultset SIGNAL). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #77423 (FILTER_VALIDATE_URL accepts URLs with invalid userinfo).
|
||||
(CVE-2020-7071) (cmb)
|
||||
. Fixed bug #80366 (Return Value of zend_fstat() not Checked). (sagpant, cmb)
|
||||
. Fixed bug #80411 (References to null-serialized object break serialize()).
|
||||
(Nikita)
|
||||
|
||||
- Tidy:
|
||||
. Fixed bug #77594 (ob_tidyhandler is never reset). (cmb)
|
||||
|
||||
- Zlib:
|
||||
. Fixed #48725 (Support for flushing in zlib stream). (cmb)
|
||||
|
||||
26 Nov 2020, PHP 7.4.13
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80280 (ADD_EXTENSION_DEP() fails for ext/standard and ext/date).
|
||||
(cmb)
|
||||
. Fixed bug #80258 (Windows Deduplication Enabled, randon permission errors).
|
||||
(cmb)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #62474 (com_event_sink crashes on certain arguments). (cmb)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #80268 (loadHTML() truncates at NUL bytes). (cmb)
|
||||
|
||||
- FFI:
|
||||
. Fixed bug #79177 (FFI doesn't handle well PHP exceptions within callback).
|
||||
(cmb, Dmitry, Nikita)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb)
|
||||
. Fixed bug #76618 (segfault on imap_reopen). (girgias)
|
||||
. Fixed bug #80239 (imap_rfc822_write_address() leaks memory). (cmb)
|
||||
. Fixed minor regression caused by fixing bug #80220. (cmb)
|
||||
. Fixed bug #80242 (imap_mail_compose() segfaults for multipart with rfc822).
|
||||
(cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #79375 (mysqli_store_result does not report error from lock wait
|
||||
timeout). (Kamil Tekiela, Nikita)
|
||||
. Fixed bug #76525 (mysqli::commit does not throw if MYSQLI_REPORT_ERROR
|
||||
enabled and mysqlnd used). (Kamil Tekiela)
|
||||
. Fixed bug #72413 (mysqlnd segfault (fetch_row second parameter
|
||||
typemismatch)). (Kamil Tekiela)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #44618 (Fetching may rely on uninitialized data). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #79643 (PHP with Opcache crashes when a file with specific name
|
||||
is included). (twosee)
|
||||
. Fixed run-time binding of preloaded dynamically declared function. (Dmitry)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79983 (openssl_encrypt / openssl_decrypt fail with OCB mode).
|
||||
(Nikita)
|
||||
|
||||
- PDO MySQL:
|
||||
. Fixed bug #66528 (No PDOException or errorCode if database becomes
|
||||
unavailable before PDO::commit). (Nikita)
|
||||
. Fixed bug #65825 (PDOStatement::fetch() does not throw exception on broken
|
||||
server connection). (Nikita)
|
||||
|
||||
- SNMP:
|
||||
. Fixed bug #70461 (disable md5 code when it is not supported in net-snmp).
|
||||
(Alexander Bergmann, cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #80266 (parse_url silently drops port number 0). (cmb, Nikita)
|
||||
|
||||
29 Oct 2020, PHP 7.4.12
|
||||
|
||||
- Core:
|
||||
. Fixed bug #80061 (Copying large files may have suboptimal performance).
|
||||
(cmb)
|
||||
. Fixed bug #79423 (copy command is limited to size of file it can copy).
|
||||
(cmb)
|
||||
. Fixed bug #80126 (Covariant return types failing compilation). (Nikita)
|
||||
. Fixed bug #80186 (Segfault when iterating over FFI object). (Nikita)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #80185 (jdtounix() fails after 2037). (cmb)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #80213 (imap_mail_compose() segfaults on certain $bodies). (cmb)
|
||||
. Fixed bug #80215 (imap_mail_compose() may modify by-val parameters). (cmb)
|
||||
. Fixed bug #80220 (imap_mail_compose() may leak memory). (cmb)
|
||||
. Fixed bug #80223 (imap_mail_compose() leaks envelope on malformed bodies).
|
||||
(cmb)
|
||||
. Fixed bug #80216 (imap_mail_compose() does not validate types/encodings).
|
||||
(cmb)
|
||||
. Fixed bug #80226 (imap_sort() leaks sortpgm memory). (cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #80115 (mysqlnd.debug doesn't recognize absolute paths with
|
||||
slashes). (cmb)
|
||||
. Fixed bug #80107 (mysqli_query() fails for ~16 MB long query when
|
||||
compression is enabled). (Nikita)
|
||||
|
||||
- ODBC:
|
||||
. Fixed bug #78470 (odbc_specialcolumns() no longer accepts $nullable). (cmb)
|
||||
. Fixed bug #80147 (BINARY strings may not be properly zero-terminated).
|
||||
(cmb)
|
||||
. Fixed bug #80150 (Failure to fetch error message). (cmb)
|
||||
. Fixed bug #80152 (odbc_execute() moves internal pointer of $params). (cmb)
|
||||
. Fixed bug #46050 (odbc_next_result corrupts prepared resource). (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #80083 (Optimizer pass 6 removes variables used for ibm_db2 data
|
||||
binding). (Nikita)
|
||||
. Fixed bug #80194 (Assertion failure during block assembly of unreachable
|
||||
free with leading nop). (Nikita)
|
||||
|
||||
- PCRE:
|
||||
. Updated to PCRE 10.35. (cmb)
|
||||
. Fixed bug #80118 (Erroneous whitespace match with JIT only). (cmb)
|
||||
|
||||
- PDO_ODBC:
|
||||
. Fixed bug #67465 (NULL Pointer dereference in odbc_handle_preparer). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #80114 (parse_url does not accept URLs with port 0). (cmb, twosee)
|
||||
. Fixed bug #76943 (Inconsistent stream_wrapper_restore() errors). (cmb)
|
||||
. Fixed bug #76735 (Incorrect message in fopen on invalid mode). (cmb)
|
||||
|
||||
- Tidy:
|
||||
. Fixed bug #77040 (tidyNode::isHtml() is completely broken). (cmb)
|
||||
|
||||
01 Oct 2020, PHP 7.4.11
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79979 (passing value to by-ref param via CUFA crashes). (cmb,
|
||||
Nikita)
|
||||
. Fixed bug #80037 (Typed property must not be accessed before initialization
|
||||
when __get() declared). (Nikita)
|
||||
. Fixed bug #80048 (Bug #69100 has not been fixed for Windows). (cmb)
|
||||
. Fixed bug #80049 (Memleak when coercing integers to string via variadic
|
||||
argument). (Nikita)
|
||||
. Fixed bug #79699 (PHP parses encoded cookie names so malicious `__Host-`
|
||||
cookies can be sent). (CVE-2020-7070) (Stas)
|
||||
|
||||
- Calendar:
|
||||
. Fixed bug #80007 (Potential type confusion in unixtojd() parameter parsing).
|
||||
(Andy Postnikov)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #64130 (COM obj parameters passed by reference are not updated).
|
||||
(cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #80002 (calc free space for new interned string is wrong).
|
||||
(t-matsuno)
|
||||
. Fixed bug #80046 (FREE for SWITCH_STRING optimized away). (Nikita)
|
||||
. Fixed bug #79825 (opcache.file_cache causes SIGSEGV when custom opcode
|
||||
handlers changed). (SammyK)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79601 (Wrong ciphertext/tag in AES-CCM encryption for a 12
|
||||
bytes IV). (CVE-2020-7069) (Jakub Zelenka)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #80027 (Terrible performance using $query->fetch on queries with
|
||||
many bind parameters). (Matteo)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #47021 (SoapClient stumbles over WSDL delivered with
|
||||
"Transfer-Encoding: chunked"). (Matteo)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79986 (str_ireplace bug with diacritics characters). (cmb)
|
||||
. Fixed bug #80077 (getmxrr test bug). (Rainer Jung)
|
||||
. Fixed bug #72941 (Modifying bucket->data by-ref has no effect any longer).
|
||||
(cmb)
|
||||
. Fixed bug #80067 (Omitting the port in bindto setting errors). (cmb)
|
||||
|
||||
03 Sep 2020, PHP 7.4.10
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79884 (PHP_CONFIG_FILE_PATH is meaningless). (cmb)
|
||||
. Fixed bug #77932 (File extensions are case-sensitive). (cmb)
|
||||
. Fixed bug #79806 (realpath() erroneously resolves link to link). (cmb)
|
||||
. Fixed bug #79895 (PHP_CHECK_GCC_ARG does not allow flags with equal sign).
|
||||
(Santiago M. Mola)
|
||||
. Fixed bug #79919 (Stack use-after-scope in define()). (cmb)
|
||||
. Fixed bug #79934 (CRLF-only line in heredoc causes parsing error).
|
||||
(Pieter van den Ham)
|
||||
. Fixed bug #79947 (Memory leak on invalid offset type in compound
|
||||
assignment). (Nikita)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #48585 (com_load_typelib holds reference, fails on second call).
|
||||
(cmb)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #75785 (Many errors from exif_read_data).
|
||||
(Níckolas Daniel da Silva)
|
||||
|
||||
- Gettext:
|
||||
. Fixed bug #70574 (Tests fail due to relying on Linux fallback behavior for
|
||||
gettext()). (Florian Engelhardt)
|
||||
|
||||
- LDAP:
|
||||
. Fixed memory leaks. (ptomulik)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #73060 (php failed with error after temp folder cleaned up).
|
||||
(cmb)
|
||||
. Fixed bug #79917 (File cache segfault with a static variable in inherited
|
||||
method). (Nikita)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #64705 (errorInfo property of PDOException is null when
|
||||
PDO::__construct() fails). (Ahmed Abdou)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #79724 (Return type does not match in ext/session/mod_mm.c).
|
||||
(Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79930 (array_merge_recursive() crashes when called with array
|
||||
with single reference). (Nikita)
|
||||
. Fixed bug #79944 (getmxrr always returns true on Alpine linux). (Nikita)
|
||||
. Fixed bug #79951 (Memory leak in str_replace of empty string). (Nikita)
|
||||
|
||||
- XML:
|
||||
. Fixed bug #79922 (Crash after multiple calls to xml_parser_free()). (cmb)
|
||||
|
||||
06 Aug 2020, PHP 7.4.9
|
||||
|
||||
- Apache:
|
||||
. Fixed bug #79030 (Upgrade apache2handler's php_apache_sapi_get_request_time
|
||||
to return usec). (Herbert256)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #63208 (BSTR to PHP string conversion not binary safe). (cmb)
|
||||
. Fixed bug #63527 (DCOM does not work with Username, Password parameter).
|
||||
(cmb)
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79877 (getimagesize function silently truncates after a null
|
||||
byte) (cmb)
|
||||
. Fixed bug #79740 (serialize() and unserialize() methods can not be called
|
||||
statically). (Nikita)
|
||||
. Fixed bug #79783 (Segfault in php_str_replace_common). (Nikita)
|
||||
. Fixed bug #79778 (Assertion failure if dumping closure with unresolved
|
||||
static variable). (Nikita)
|
||||
. Fixed bug #79779 (Assertion failure when assigning property of string
|
||||
offset by reference). (Nikita)
|
||||
. Fixed bug #79792 (HT iterators not removed if empty array is destroyed).
|
||||
(Nikita)
|
||||
. Fixed bug #78598 (Changing array during undef index RW error segfaults).
|
||||
(Nikita)
|
||||
. Fixed bug #79784 (Use after free if changing array during undef var during
|
||||
array write fetch). (Nikita)
|
||||
. Fixed bug #79793 (Use after free if string used in undefined index warning
|
||||
is changed). (Nikita)
|
||||
. Fixed bug #79862 (Public non-static property in child should take priority
|
||||
over private static). (Nikita)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #79756 (finfo_file crash (FILEINFO_MIME)). (cmb)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #55857 (ftp_size on large files). (cmb)
|
||||
|
||||
- Mbstring:
|
||||
. Fixed bug #79787 (mb_strimwidth does not trim string). (XXiang)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79881 (Memory leak in openssl_pkey_get_public()). (Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #79797 (Use of freed hash key in the phar_parse_zipfile
|
||||
function). (CVE-2020-7068) (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #79487 (::getStaticProperties() ignores property modifications).
|
||||
(cmb, Nikita)
|
||||
. Fixed bug #69804 (::getStaticPropertyValue() throws on protected props).
|
||||
(cmb, Nikita)
|
||||
. Fixed bug #79820 (Use after free when type duplicated into
|
||||
ReflectionProperty gets resolved). (Christopher Broadbent)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #70362 (Can't copy() large 'data://' with open_basedir). (cmb)
|
||||
. Fixed bug #78008 (dns_check_record() always return true on Alpine).
|
||||
(Andy Postnikov)
|
||||
. Fixed bug #79839 (array_walk() does not respect property types). (Nikita)
|
||||
|
||||
09 Jul 2020, PHP 7.4.8
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79595 (zend_init_fpu() alters FPU precision). (cmb, Nikita)
|
||||
. Fixed bug #79650 (php-win.exe 100% cpu lockup). (cmb)
|
||||
. Fixed bug #79668 (get_defined_functions(true) may miss functions). (cmb,
|
||||
Nikita)
|
||||
. Fixed bug #79683 (Fake reflection scope affects __toString()). (Nikita)
|
||||
. Fixed possibly unsupported timercmp() usage. (cmb)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #79687 (Sony picture - PHP Warning - Make, Model, MakerNotes).
|
||||
(cmb)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #79681 (mime_content_type/finfo returning incorrect mimetype).
|
||||
(cmb)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug #73527 (Invalid memory access in php_filter_strip). (cmb)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #79676 (imagescale adds black border with IMG_BICUBIC). (cmb)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #62890 (default_socket_timeout=-1 causes connection to timeout).
|
||||
(cmb)
|
||||
|
||||
- PDO SQLite:
|
||||
. Fixed bug #79664 (PDOStatement::getColumnMeta fails on empty result set).
|
||||
(cmb)
|
||||
|
||||
- phpdbg:
|
||||
. Fixed bug #73926 (phpdbg will not accept input on restart execution). (cmb)
|
||||
. Fixed bug #73927 (phpdbg fails with windows error prompt at "watch array").
|
||||
(cmb)
|
||||
. Fixed several mostly Windows related phpdbg bugs. (cmb)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #79710 (Reproducible segfault in error_handler during GC
|
||||
involved an SplFileObject). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #74267 (segfault with streams and invalid data). (cmb)
|
||||
. Fixed bug #79579 (ZTS build of PHP 7.3.17 doesn't handle ERANGE for
|
||||
posix_getgrgid and others). (Böszörményi Zoltán)
|
||||
|
||||
11 Jun 2020, PHP 7.4.7
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79599 (coredump in set_error_handler). (Laruence)
|
||||
. Fixed bug #79566 (Private SHM is not private on Windows). (cmb)
|
||||
. Fixed bug #79489 (.user.ini does not inherit). (cmb)
|
||||
. Fixed bug #79600 (Regression in 7.4.6 when yielding an array based
|
||||
generator). (Nikita)
|
||||
. Fixed bug #79657 ("yield from" hangs when invalid value encountered).
|
||||
(Nikita)
|
||||
|
||||
- FFI:
|
||||
. Fixed bug #79571 (FFI: var_dumping unions may segfault). (cmb)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #79615 (Wrong GIF header written in GD GIFEncode). (sageptr, cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #79596 (MySQL FLOAT truncates to int some locales). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #79588 (Boolean opcache settings ignore on/off values). (cmb)
|
||||
. Fixed bug #79548 (Preloading segfault with inherited method using static
|
||||
variable). (Nikita)
|
||||
. Fixed bug #79603 (RTD collision with opcache). (Nikita)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79561 (dns_get_record() fails with DNS_ALL). (cmb)
|
||||
|
||||
14 May 2020, PHP 7.4.6
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79536 (zend_clear_exception prevent exception's destructor to be
|
||||
called). (Laruence)
|
||||
. Fixed bug #78434 (Generator yields no items after valid() call). (Nikita)
|
||||
. Fixed bug #79477 (casting object into array creates references). (Nikita)
|
||||
. Fixed bug #79514 (Memory leaks while including unexistent file). (cmb,
|
||||
Nikita)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #78221 (DOMNode::normalize() doesn't remove empty text nodes).
|
||||
(cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #79336 (ext/exif/tests/bug79046.phpt fails on Big endian arch).
|
||||
(Nikita)
|
||||
|
||||
- FCGI:
|
||||
. Fixed bug #79491 (Search for .user.ini extends up to root dir). (cmb)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug #79441 (Segfault in mb_chr() if internal encoding is unsupported).
|
||||
(Girgias)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79497 (stream_socket_client() throws an unknown error sometimes
|
||||
with <1s timeout). (Joe Cai)
|
||||
|
||||
- PCRE:
|
||||
. Upgraded to PCRE2 10.34. (cmb)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #79503 (Memory leak on duplicate metadata). (cmb)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #79528 (Different object of the same xml between 7.4.5 and
|
||||
7.4.4). (cmb)
|
||||
|
||||
- SPL:
|
||||
. Fixed bug #69264 (__debugInfo() ignored while extending SPL classes). (cmb)
|
||||
. Fixed bug #67369 (ArrayObject serialization drops the iterator class).
|
||||
(Alex Dowad)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79468 (SIGSEGV when closing stream handle with a stream filter
|
||||
appended). (dinosaur)
|
||||
. Fixed bug #79447 (Serializing uninitialized typed properties with __sleep
|
||||
should not throw). (nicolas-grekas)
|
||||
|
||||
16 Apr 2020, PHP 7.4.5
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79364 (When copy empty array, next key is unspecified). (cmb)
|
||||
. Fixed bug #78210 (Invalid pointer address). (cmb, Nikita)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #79199 (curl_copy_handle() memory leak). (cmb)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #79396 (DateTime hour incorrect during DST jump forward). (Nate
|
||||
Brunette)
|
||||
. Fixed bug #74940 (DateTimeZone loose comparison always true). (cmb)
|
||||
|
||||
- FPM:
|
||||
. Implement request #77062 (Allow numeric [UG]ID in FPM listen.{owner,group})
|
||||
(Andre Nathan)
|
||||
|
||||
- Iconv:
|
||||
. Fixed bug #79200 (Some iconv functions cut Windows-1258). (cmb)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #79412 (Opcache chokes and uses 100% CPU on specific script).
|
||||
(Dmitry)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #79413 (session_create_id() fails for active sessions). (cmb)
|
||||
|
||||
- Shmop:
|
||||
. Fixed bug #79427 (Integer Overflow in shmop_open()). (cmb)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #61597 (SXE properties may lack attributes and content). (cmb)
|
||||
|
||||
- SOAP:
|
||||
. Fixed bug #79357 (SOAP request segfaults when any request parameter is
|
||||
missing). (Nikita)
|
||||
|
||||
- Spl:
|
||||
. Fixed bug #75673 (SplStack::unserialize() behavior). (cmb)
|
||||
. Fixed bug #79393 (Null coalescing operator failing with SplFixedArray).
|
||||
(cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79330 (shell_exec() silently truncates after a null byte). (stas)
|
||||
. Fixed bug #79465 (OOB Read in urldecode()). (CVE-2020-7067) (stas)
|
||||
. Fixed bug #79410 (system() swallows last chunk if it is exactly 4095 bytes
|
||||
without newline). (Christian Schneider)
|
||||
|
||||
- Zip:
|
||||
. Fixed Bug #79296 (ZipArchive::open fails on empty file). (Remi)
|
||||
. Fixed bug #79424 (php_zip_glob uses gl_pathc after call to globfree).
|
||||
(Max Rees)
|
||||
|
||||
19 Mar 2020, PHP 7.4.4
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79244 (php crashes during parsing INI file). (Laruence)
|
||||
. Fixed bug #63206 (restore_error_handler does not restore previous errors
|
||||
mask). (Mark Plomer)
|
||||
|
||||
- COM:
|
||||
. Fixed bug #66322 (COMPersistHelper::SaveToFile can save to wrong location).
|
||||
(cmb)
|
||||
. Fixed bug #79242 (COM error constants don't match com_exception codes on
|
||||
x86). (cmb)
|
||||
. Fixed bug #79247 (Garbage collecting variant objects segfaults). (cmb)
|
||||
. Fixed bug #79248 (Traversing empty VT_ARRAY throws com_exception). (cmb)
|
||||
. Fixed bug #79299 (com_print_typeinfo prints duplicate variables). (Litiano
|
||||
Moura)
|
||||
. Fixed bug #79332 (php_istreams are never freed). (cmb)
|
||||
. Fixed bug #79333 (com_print_typeinfo() leaks memory). (cmb)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #79019 (Copied cURL handles upload empty file). (cmb)
|
||||
. Fixed bug #79013 (Content-Length missing when posting a curlFile with
|
||||
curl). (cmb)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug #77569: (Write Access Violation in DomImplementation). (Nikita,
|
||||
cmb)
|
||||
. Fixed bug #79271 (DOMDocumentType::$childNodes is NULL). (cmb)
|
||||
|
||||
- Enchant:
|
||||
. Fixed bug #79311 (enchant_dict_suggest() fails on big endian architecture).
|
||||
(cmb)
|
||||
|
||||
- EXIF:
|
||||
. Fixed bug #79282 (Use-of-uninitialized-value in exif). (CVE-2020-7064)
|
||||
(Nikita)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #79283 (Segfault in libmagic patch contains a buffer
|
||||
overflow). (cmb)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug #77653 (operator displayed instead of the real error message).
|
||||
(Jakub Zelenka)
|
||||
. Fixed bug #79014 (PHP-FPM & Primary script unknown). (Jakub Zelenka)
|
||||
|
||||
- MBstring:
|
||||
. Fixed bug #79371 (mb_strtolower (UTF-32LE): stack-buffer-overflow at
|
||||
php_unicode_tolower_full). (CVE-2020-7065) (cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #64032 (mysqli reports different client_version). (cmb)
|
||||
|
||||
- MySQLnd:
|
||||
. Implemented FR #79275 (Support auth_plugin_caching_sha2_password on
|
||||
Windows). (cmb)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #79252 (preloading causes php-fpm to segfault during exit).
|
||||
(Nikita)
|
||||
|
||||
- PCRE:
|
||||
. Fixed bug #79188 (Memory corruption in preg_replace/preg_replace_callback
|
||||
and unicode). (Nikita)
|
||||
. Fixed bug #79241 (Segmentation fault on preg_match()). (Nikita)
|
||||
. Fixed bug #79257 (Duplicate named groups (?J) prefer last alternative even
|
||||
if not matched). (Nikita)
|
||||
|
||||
- PDO_ODBC:
|
||||
. Fixed bug #79038 (PDOStatement::nextRowset() leaks column values). (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #79062 (Property with heredoc default value returns false for
|
||||
getDocComment). (Nikita)
|
||||
|
||||
- SQLite3:
|
||||
. Fixed bug #79294 (::columnType() may fail after SQLite3Stmt::reset()). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79329 (get_headers() silently truncates after a null byte).
|
||||
(CVE-2020-7066) (cmb)
|
||||
. Fixed bug #79254 (getenv() w/o arguments not showing changes). (cmb)
|
||||
. Fixed bug #79265 (Improper injection of Host header when using fopen for
|
||||
http requests). (Miguel Xavier Penha Neto)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #79315 (ZipArchive::addFile doesn't honor start/length
|
||||
parameters). (Remi)
|
||||
|
||||
20 Feb 2020, PHP 7.4.3
|
||||
|
||||
- Core:
|
||||
. Fixed bug #79146 (cscript can fail to run on some systems). (clarodeus)
|
||||
. Fixed bug #79155 (Property nullability lost when using multiple property
|
||||
definition). (Nikita)
|
||||
. Fixed bug #78323 (Code 0 is returned on invalid options). (Ivan Mikheykin)
|
||||
. Fixed bug #78989 (Delayed variance check involving trait segfaults).
|
||||
(Nikita)
|
||||
. Fixed bug #79174 (cookie values with spaces fail to round-trip). (cmb)
|
||||
. Fixed bug #76047 (Use-after-free when accessing already destructed
|
||||
backtrace arguments). (Nikita)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #79078 (Hypothetical use-after-free in curl_multi_add_handle()).
|
||||
(cmb)
|
||||
|
||||
- FFI:
|
||||
. Fixed bug #79096 (FFI Struct Segfault). (cmb)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #79112 (IMAP extension can't find OpenSSL libraries at configure
|
||||
time). (Nikita)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #79212 (NumberFormatter::format() may detect wrong type). (cmb)
|
||||
|
||||
- Libxml:
|
||||
. Fixed bug #79191 (Error in SoapClient ctor disables DOMDocument::save()).
|
||||
(Nikita, cmb)
|
||||
|
||||
- MBString:
|
||||
. Fixed bug #79149 (SEGV in mb_convert_encoding with non-string encodings).
|
||||
(cmb)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #78666 (Properties may emit a warning on var_dump()). (kocsismate)
|
||||
|
||||
- MySQLnd:
|
||||
. Fixed bug #79084 (mysqlnd may fetch wrong column indexes with MYSQLI_BOTH).
|
||||
(cmb)
|
||||
. Fixed bug #79011 (MySQL caching_sha2_password Access denied for password
|
||||
with more than 20 chars). (Nikita)
|
||||
|
||||
- Opcache:
|
||||
. Fixed bug #79114 (Eval class during preload causes class to be only half
|
||||
available). (Laruence)
|
||||
. Fixed bug #79128 (Preloading segfaults if preload_user is used). (Nikita)
|
||||
. Fixed bug #79193 (Incorrect type inference for self::$field =& $field).
|
||||
(Nikita)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed bug #79145 (openssl memory leak). (cmb, Nikita)
|
||||
|
||||
- Phar:
|
||||
. Fixed bug #79082 (Files added to tar with Phar::buildFromIterator have
|
||||
all-access permissions). (CVE-2020-7063) (stas)
|
||||
. Fixed bug #79171 (heap-buffer-overflow in phar_extract_file).
|
||||
(CVE-2020-7061) (cmb)
|
||||
. Fixed bug #76584 (PharFileInfo::decompress not working). (cmb)
|
||||
|
||||
- Reflection:
|
||||
. Fixed bug #79115 (ReflectionClass::isCloneable call reflected class
|
||||
__destruct). (Nikita)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #79221 (Null Pointer Dereference in PHP Session Upload Progress).
|
||||
(CVE-2020-7062) (stas)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #78902 (Memory leak when using stream_filter_append). (liudaixiao)
|
||||
. Fixed bug #78969 (PASSWORD_DEFAULT should match PASSWORD_BCRYPT instead of being null). (kocsismate)
|
||||
|
||||
- Testing:
|
||||
. Fixed bug #78090 (bug45161.phpt takes forever to finish). (cmb)
|
||||
|
||||
- XSL:
|
||||
. Fixed bug #70078 (XSL callbacks with nodes as parameter leak memory). (cmb)
|
||||
|
||||
- Zip:
|
||||
. Add ZipArchive::CM_LZMA2 and ZipArchive::CM_XZ constants (since libzip 1.6.0). (Remi)
|
||||
. Add ZipArchive::RDONLY (since libzip 1.0.0). (Remi)
|
||||
. Add ZipArchive::ER_* missing constants. (Remi)
|
||||
. Add ZipArchive::LIBZIP_VERSION constant. (Remi)
|
||||
. Fixed bug #73119 (Wrong return for ZipArchive::addEmptyDir Method). (Remi)
|
||||
|
||||
23 Jan 2020, PHP 7.4.2
|
||||
|
||||
- Core:
|
||||
. Preloading support on Windows has been disabled. (Nikita)
|
||||
. Fixed bug #79022 (class_exists returns True for classes that are not ready
|
||||
to be used). (Laruence)
|
||||
. Fixed bug #78929 (plus signs in cookie values are converted to spaces).
|
||||
(Alexey Kachalin)
|
||||
. Fixed bug #78973 (Destructor during CV freeing causes segfault if opline
|
||||
never saved). (Nikita)
|
||||
. Fixed bug #78776 (Abstract method implementation from trait does not check
|
||||
"static"). (Nikita)
|
||||
. Fixed bug #78999 (Cycle leak when using function result as temporary).
|
||||
(Dmitry)
|
||||
. Fixed bug #79008 (General performance regression with PHP 7.4 on Windows).
|
||||
(cmb)
|
||||
. Fixed bug #79002 (Serializing uninitialized typed properties with __sleep
|
||||
makes unserialize throw). (Nikita)
|
||||
|
||||
- CURL:
|
||||
. Fixed bug #79033 (Curl timeout error with specific url and post). (cmb)
|
||||
. Fixed bug #79063 (curl openssl does not respect PKG_CONFIG_PATH). (Nikita)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #79015 (undefined-behavior in php_date.c). (cmb)
|
||||
|
||||
- DBA:
|
||||
. Fixed bug #78808 ([LMDB] MDB_MAP_FULL: Environment mapsize limit reached).
|
||||
(cmb)
|
||||
|
||||
- Exif:
|
||||
. Fixed bug #79046 (NaN to int cast undefined behavior in exif). (Nikita)
|
||||
|
||||
- Fileinfo:
|
||||
. Fixed bug #74170 (locale information change after mime_content_type).
|
||||
(Sergei Turchanov)
|
||||
|
||||
- GD:
|
||||
. Fixed bug #79067 (gdTransformAffineCopy() may use unitialized values). (cmb)
|
||||
. Fixed bug #79068 (gdTransformAffineCopy() changes interpolation method).
|
||||
(cmb)
|
||||
|
||||
- Libxml:
|
||||
. Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter). (Laruence)
|
||||
|
||||
- OPcache:
|
||||
. Fixed bug #78961 (erroneous optimization of re-assigned $GLOBALS). (Dmitry)
|
||||
. Fixed bug #78950 (Preloading trait method with static variables). (Nikita)
|
||||
. Fixed bug #78903 (Conflict in RTD key for closures results in crash).
|
||||
(Nikita)
|
||||
. Fixed bug #78986 (Opcache segfaults when inheriting ctor from immutable
|
||||
into mutable class). (Nikita)
|
||||
. Fixed bug #79040 (Warning Opcode handlers are unusable due to ASLR). (cmb)
|
||||
. Fixed bug #79055 (Typed property become unknown with OPcache file cache).
|
||||
(Nikita)
|
||||
|
||||
- Pcntl:
|
||||
. Fixed bug #78402 (Converting null to string in error message is bad DX).
|
||||
(SATŌ Kentarō)
|
||||
|
||||
- PDO_PgSQL:
|
||||
. Fixed bug #78983 (pdo_pgsql config.w32 cannot find libpq-fe.h). (SATŌ
|
||||
Kentarō)
|
||||
. Fixed bug #78980 (pgsqlGetNotify() overlooks dead connection). (SATŌ
|
||||
Kentarō)
|
||||
. Fixed bug #78982 (pdo_pgsql returns dead persistent connection). (SATŌ
|
||||
Kentarō)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #79031 (Session unserialization problem). (Nikita)
|
||||
|
||||
- Shmop:
|
||||
. Fixed bug #78538 (shmop memory leak). (cmb)
|
||||
|
||||
- Sqlite3:
|
||||
. Fixed bug #79056 (sqlite does not respect PKG_CONFIG_PATH during
|
||||
compilation). (Nikita)
|
||||
|
||||
- Spl:
|
||||
. Fixed bug #78976 (SplFileObject::fputcsv returns -1 on failure). (cmb)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #79000 (Non-blocking socket stream reports EAGAIN as error).
|
||||
(Nikita)
|
||||
. Fixed bug #54298 (Using empty additional_headers adding extraneous CRLF).
|
||||
(cmb)
|
||||
|
||||
18 Dec 2019, PHP 7.4.1
|
||||
12 Dec 2019, PHP 7.4.1RC1
|
||||
|
||||
- Core:
|
||||
. Fixed bug #78810 (RW fetches do not throw "uninitialized property"
|
||||
|
||||
+8
-16
@@ -615,16 +615,14 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
|
||||
{/*{{{*/
|
||||
shm_pair *shm;
|
||||
char shm_segment[26], shm_info[29];
|
||||
HANDLE shm_handle = NULL, info_handle = NULL;
|
||||
HANDLE shm_handle, info_handle;
|
||||
BOOL created = FALSE;
|
||||
|
||||
if (key != IPC_PRIVATE) {
|
||||
snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key);
|
||||
snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key);
|
||||
snprintf(shm_segment, sizeof(shm_segment), "TSRM_SHM_SEGMENT:%d", key);
|
||||
snprintf(shm_info, sizeof(shm_info), "TSRM_SHM_DESCRIPTOR:%d", key);
|
||||
|
||||
shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment);
|
||||
info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info);
|
||||
}
|
||||
shm_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_segment);
|
||||
info_handle = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, shm_info);
|
||||
|
||||
if (!shm_handle && !info_handle) {
|
||||
if (flags & IPC_CREAT) {
|
||||
@@ -635,8 +633,8 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
|
||||
DWORD high = 0;
|
||||
DWORD low = size;
|
||||
#endif
|
||||
shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, high, low, key == IPC_PRIVATE ? NULL : shm_segment);
|
||||
info_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shm->descriptor), key == IPC_PRIVATE ? NULL : shm_info);
|
||||
shm_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, high, low, shm_segment);
|
||||
info_handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(shm->descriptor), shm_info);
|
||||
created = TRUE;
|
||||
}
|
||||
if (!shm_handle || !info_handle) {
|
||||
@@ -722,7 +720,6 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
|
||||
TSRM_API int shmdt(const void *shmaddr)
|
||||
{/*{{{*/
|
||||
shm_pair *shm = shm_get(0, (void*)shmaddr);
|
||||
int ret;
|
||||
|
||||
if (!shm->segment) {
|
||||
return -1;
|
||||
@@ -732,12 +729,7 @@ TSRM_API int shmdt(const void *shmaddr)
|
||||
shm->descriptor->shm_lpid = getpid();
|
||||
shm->descriptor->shm_nattch--;
|
||||
|
||||
ret = UnmapViewOfFile(shm->addr) ? 0 : -1;
|
||||
if (!ret && shm->descriptor->shm_nattch <= 0) {
|
||||
ret = UnmapViewOfFile(shm->descriptor) ? 0 : -1;
|
||||
shm->descriptor = NULL;
|
||||
}
|
||||
return ret;
|
||||
return UnmapViewOfFile(shm->addr) ? 0 : -1;
|
||||
}/*}}}*/
|
||||
|
||||
TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf)
|
||||
|
||||
@@ -69,12 +69,6 @@ PHP 7.4 UPGRADE NOTES
|
||||
a warning and always return false. Previously all DateInterval objects were
|
||||
considered equal, unless they had properties.
|
||||
|
||||
DOM:
|
||||
. As of PHP 7.4.4, the value of the $childNodes property of DOMDocument,
|
||||
DOMNode, DOMProcessingInstruction, DOMComment, DOMText, DOMCdataSection and
|
||||
DOMNotation is now an empty DOMNodeList instead of NULL, according to the
|
||||
W3C and WHATWG standards and the PHP manual.
|
||||
|
||||
- Intl:
|
||||
. The default parameter value of idn_to_ascii() and idn_to_utf8() is now
|
||||
INTL_IDNA_VARIANT_UTS46 instead of the deprecated INTL_IDNA_VARIANT_2003.
|
||||
@@ -125,11 +119,6 @@ DOM:
|
||||
After: ReflectionMethod::getClosure($object = null)
|
||||
The new signature is also (LSP) compatible with older PHP versions.
|
||||
|
||||
- SAPI:
|
||||
. Starting with 7.4.11, incoming cookie names are not url-decoded. This was never
|
||||
required by the standard, outgoing cookie names aren't encoded and this leads
|
||||
to security issues (CVE-2020-7070).
|
||||
|
||||
- SPL:
|
||||
. Calling get_object_vars() on an ArrayObject instance will now always return
|
||||
the properties of the ArrayObject itself (or a subclass). Previously it
|
||||
@@ -161,7 +150,7 @@ DOM:
|
||||
. Password hashing algorithm identifiers are now nullable strings rather
|
||||
than integers.
|
||||
|
||||
* PASSWORD_DEFAULT was int 1; now is null in PHP <7.4.3 and string '2y' afterwards
|
||||
* PASSWORD_DEFAULT was int 1; now is null
|
||||
* PASSWORD_BCRYPT was int 1; now is string '2y'
|
||||
* PASSWORD_ARGON2I was int 2; now is string 'argon2i'
|
||||
* PASSWORD_ARGON2ID was int 3; now is string 'argon2id'
|
||||
@@ -574,12 +563,6 @@ DOM:
|
||||
9. Other Changes to Extensions
|
||||
========================================
|
||||
|
||||
DBA:
|
||||
. As of PHP 7.4.2, dba_open() accepts a fifth optional parameter for lmdb
|
||||
databases which allows to specify the mapsize. The parameter defaults to
|
||||
zero, in which case the compiled in default mapsize (usually 1048576) will
|
||||
be used. The mapsize should be a multiple of the page size of the OS.
|
||||
|
||||
- GD:
|
||||
. The behavior of imagecropauto() in the bundled libgd has been synced with
|
||||
that of system libgd:
|
||||
@@ -737,7 +720,7 @@ DOM:
|
||||
the INI directive opcache.cache_id. All processes with the same cache ID and
|
||||
user share an OPcache instance.
|
||||
|
||||
- The OpenSSL default config path has been changed to
|
||||
- The OpenSSL default config path has been changed to
|
||||
"C:\Program Files\Common Files\SSL\openssl.cnf" and
|
||||
"C:\Program Files (x86)\Common Files\SSL\openssl.cnf", respectively.
|
||||
|
||||
|
||||
+2
-2
@@ -213,8 +213,8 @@ PHP 7.4 INTERNALS UPGRADE NOTES
|
||||
an exception. For instructions on how to gracefully handle this see
|
||||
https://wiki.php.net/rfc/tostring_exceptions#extension_guidelines.
|
||||
|
||||
u. The typedefs uint and ulong are no longer guaranteed to be available, and
|
||||
have to be replaced with standard types.
|
||||
u. The Windows typedefs uint and ulong are no longer available, and have to be
|
||||
replaced with standard types.
|
||||
|
||||
v. Compound assignment opcodes were changed. Instead of ZEND_ASSIGN_ADD (and
|
||||
others) with 0, ZEND_ASSIGN_DIM, ZEND_ASSIGN_OBJ or
|
||||
|
||||
+4
-4
@@ -164,16 +164,16 @@ int main()
|
||||
double d = (double) LONG_MIN * LONG_MIN + 2e9;
|
||||
|
||||
if ((long) d == 2e9 && (long) -d == -2e9) {
|
||||
return 0;
|
||||
exit(0);
|
||||
}
|
||||
} else if (sizeof(long) == 8) {
|
||||
double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract ULONG_MAX + 1 */
|
||||
|
||||
if ((long) 18e18 == correct) { /* On 64-bit, only check between LONG_MAX and ULONG_MAX */
|
||||
return 0;
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
exit(1);
|
||||
}
|
||||
]])], [
|
||||
AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long preserves least significant bits])
|
||||
@@ -284,7 +284,7 @@ int main()
|
||||
fprintf(fp, "%d %d\n", ZEND_MM_ALIGNMENT, zeros);
|
||||
fclose(fp);
|
||||
|
||||
return 0;
|
||||
exit(0);
|
||||
}
|
||||
]])], [
|
||||
LIBZEND_MM_ALIGN=`cat conftest.zend | cut -d ' ' -f 1`
|
||||
|
||||
+37
-37
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
if (function_exists("date_default_timezone_set")) {
|
||||
date_default_timezone_set("UTC");
|
||||
date_default_timezone_set("UTC");
|
||||
}
|
||||
|
||||
function simple() {
|
||||
@@ -220,30 +220,30 @@ function heapsort_r($n, &$ra) {
|
||||
$ir = $n;
|
||||
|
||||
while (1) {
|
||||
if ($l > 1) {
|
||||
$rra = $ra[--$l];
|
||||
} else {
|
||||
$rra = $ra[$ir];
|
||||
$ra[$ir] = $ra[1];
|
||||
if (--$ir == 1) {
|
||||
$ra[1] = $rra;
|
||||
return;
|
||||
}
|
||||
}
|
||||
$i = $l;
|
||||
$j = $l << 1;
|
||||
while ($j <= $ir) {
|
||||
if (($j < $ir) && ($ra[$j] < $ra[$j+1])) {
|
||||
$j++;
|
||||
}
|
||||
if ($rra < $ra[$j]) {
|
||||
$ra[$i] = $ra[$j];
|
||||
$j += ($i = $j);
|
||||
} else {
|
||||
$j = $ir + 1;
|
||||
}
|
||||
}
|
||||
$ra[$i] = $rra;
|
||||
if ($l > 1) {
|
||||
$rra = $ra[--$l];
|
||||
} else {
|
||||
$rra = $ra[$ir];
|
||||
$ra[$ir] = $ra[1];
|
||||
if (--$ir == 1) {
|
||||
$ra[1] = $rra;
|
||||
return;
|
||||
}
|
||||
}
|
||||
$i = $l;
|
||||
$j = $l << 1;
|
||||
while ($j <= $ir) {
|
||||
if (($j < $ir) && ($ra[$j] < $ra[$j+1])) {
|
||||
$j++;
|
||||
}
|
||||
if ($rra < $ra[$j]) {
|
||||
$ra[$i] = $ra[$j];
|
||||
$j += ($i = $j);
|
||||
} else {
|
||||
$j = $ir + 1;
|
||||
}
|
||||
}
|
||||
$ra[$i] = $rra;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,9 +268,9 @@ function mkmatrix ($rows, $cols) {
|
||||
$count = 1;
|
||||
$mx = array();
|
||||
for ($i=0; $i<$rows; $i++) {
|
||||
for ($j=0; $j<$cols; $j++) {
|
||||
$mx[$i][$j] = $count++;
|
||||
}
|
||||
for ($j=0; $j<$cols; $j++) {
|
||||
$mx[$i][$j] = $count++;
|
||||
}
|
||||
}
|
||||
return($mx);
|
||||
}
|
||||
@@ -278,13 +278,13 @@ function mkmatrix ($rows, $cols) {
|
||||
function mmult ($rows, $cols, $m1, $m2) {
|
||||
$m3 = array();
|
||||
for ($i=0; $i<$rows; $i++) {
|
||||
for ($j=0; $j<$cols; $j++) {
|
||||
$x = 0;
|
||||
for ($k=0; $k<$cols; $k++) {
|
||||
$x += $m1[$i][$k] * $m2[$k][$j];
|
||||
}
|
||||
$m3[$i][$j] = $x;
|
||||
}
|
||||
for ($j=0; $j<$cols; $j++) {
|
||||
$x = 0;
|
||||
for ($k=0; $k<$cols; $k++) {
|
||||
$x += $m1[$i][$k] * $m2[$k][$j];
|
||||
}
|
||||
$m3[$i][$j] = $x;
|
||||
}
|
||||
}
|
||||
return($m3);
|
||||
}
|
||||
@@ -353,7 +353,7 @@ function gethrtime()
|
||||
|
||||
function start_test()
|
||||
{
|
||||
ob_start();
|
||||
ob_start();
|
||||
return gethrtime();
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ function end_test($start, $name)
|
||||
$pad = str_repeat(" ", 24-strlen($name)-strlen($num));
|
||||
|
||||
echo $name.$pad.$num."\n";
|
||||
ob_start();
|
||||
ob_start();
|
||||
return gethrtime();
|
||||
}
|
||||
|
||||
|
||||
+141
-141
@@ -22,220 +22,220 @@ function simpleicall($n) {
|
||||
}
|
||||
|
||||
class Foo {
|
||||
static $a = 0;
|
||||
public $b = 0;
|
||||
const TEST = 0;
|
||||
static $a = 0;
|
||||
public $b = 0;
|
||||
const TEST = 0;
|
||||
|
||||
static function read_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = self::$a;
|
||||
}
|
||||
}
|
||||
static function read_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = self::$a;
|
||||
}
|
||||
}
|
||||
|
||||
static function write_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
self::$a = 0;
|
||||
}
|
||||
}
|
||||
static function write_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
self::$a = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static function isset_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset(self::$a);
|
||||
}
|
||||
}
|
||||
static function isset_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset(self::$a);
|
||||
}
|
||||
}
|
||||
|
||||
static function empty_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty(self::$a);
|
||||
}
|
||||
}
|
||||
static function empty_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty(self::$a);
|
||||
}
|
||||
}
|
||||
|
||||
static function f() {
|
||||
}
|
||||
static function f() {
|
||||
}
|
||||
|
||||
static function call_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
self::f();
|
||||
}
|
||||
}
|
||||
static function call_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
self::f();
|
||||
}
|
||||
}
|
||||
|
||||
function read_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $this->b;
|
||||
}
|
||||
}
|
||||
function read_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $this->b;
|
||||
}
|
||||
}
|
||||
|
||||
function write_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b = 0;
|
||||
}
|
||||
}
|
||||
function write_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function assign_add_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b += 2;
|
||||
}
|
||||
}
|
||||
function assign_add_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b += 2;
|
||||
}
|
||||
}
|
||||
|
||||
function pre_inc_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
++$this->b;
|
||||
}
|
||||
}
|
||||
function pre_inc_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
++$this->b;
|
||||
}
|
||||
}
|
||||
|
||||
function pre_dec_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
--$this->b;
|
||||
}
|
||||
}
|
||||
function pre_dec_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
--$this->b;
|
||||
}
|
||||
}
|
||||
|
||||
function post_inc_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b++;
|
||||
}
|
||||
}
|
||||
function post_inc_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b++;
|
||||
}
|
||||
}
|
||||
|
||||
function post_dec_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b--;
|
||||
}
|
||||
}
|
||||
function post_dec_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->b--;
|
||||
}
|
||||
}
|
||||
|
||||
function isset_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset($this->b);
|
||||
}
|
||||
}
|
||||
function isset_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset($this->b);
|
||||
}
|
||||
}
|
||||
|
||||
function empty_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty($this->b);
|
||||
}
|
||||
}
|
||||
function empty_prop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty($this->b);
|
||||
}
|
||||
}
|
||||
|
||||
function g() {
|
||||
}
|
||||
function g() {
|
||||
}
|
||||
|
||||
function call($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->g();
|
||||
}
|
||||
}
|
||||
function call($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$this->g();
|
||||
}
|
||||
}
|
||||
|
||||
function read_const($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $this::TEST;
|
||||
}
|
||||
}
|
||||
function read_const($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $this::TEST;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function read_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = Foo::$a;
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = Foo::$a;
|
||||
}
|
||||
}
|
||||
|
||||
function write_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
Foo::$a = 0;
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
Foo::$a = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function isset_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset(Foo::$a);
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = isset(Foo::$a);
|
||||
}
|
||||
}
|
||||
|
||||
function empty_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty(Foo::$a);
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = empty(Foo::$a);
|
||||
}
|
||||
}
|
||||
|
||||
function call_static($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
Foo::f();
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
Foo::f();
|
||||
}
|
||||
}
|
||||
|
||||
function create_object($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = new Foo();
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = new Foo();
|
||||
}
|
||||
}
|
||||
|
||||
define('TEST', null);
|
||||
|
||||
function read_const($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = TEST;
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = TEST;
|
||||
}
|
||||
}
|
||||
|
||||
function read_auto_global($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $_GET;
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $_GET;
|
||||
}
|
||||
}
|
||||
|
||||
$g_var = 0;
|
||||
|
||||
function read_global_var($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $GLOBALS['g_var'];
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $GLOBALS['g_var'];
|
||||
}
|
||||
}
|
||||
|
||||
function read_hash($n) {
|
||||
$hash = array('test' => 0);
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $hash['test'];
|
||||
}
|
||||
$hash = array('test' => 0);
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $hash['test'];
|
||||
}
|
||||
}
|
||||
|
||||
function read_str_offset($n) {
|
||||
$str = "test";
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $str[1];
|
||||
}
|
||||
$str = "test";
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $str[1];
|
||||
}
|
||||
}
|
||||
|
||||
function issetor($n) {
|
||||
$val = array(0,1,2,3,4,5,6,7,8,9);
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $val ?: null;
|
||||
}
|
||||
$val = array(0,1,2,3,4,5,6,7,8,9);
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $val ?: null;
|
||||
}
|
||||
}
|
||||
|
||||
function issetor2($n) {
|
||||
$f = false; $j = 0;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ?: $j + 1;
|
||||
}
|
||||
$f = false; $j = 0;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ?: $j + 1;
|
||||
}
|
||||
}
|
||||
|
||||
function ternary($n) {
|
||||
$val = array(0,1,2,3,4,5,6,7,8,9);
|
||||
$f = false;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ? null : $val;
|
||||
}
|
||||
$val = array(0,1,2,3,4,5,6,7,8,9);
|
||||
$f = false;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ? null : $val;
|
||||
}
|
||||
}
|
||||
|
||||
function ternary2($n) {
|
||||
$f = false; $j = 0;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ? $f : $j + 1;
|
||||
}
|
||||
$f = false; $j = 0;
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
$x = $f ? $f : $j + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*****/
|
||||
|
||||
function empty_loop($n) {
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
}
|
||||
for ($i = 0; $i < $n; ++$i) {
|
||||
}
|
||||
}
|
||||
|
||||
function gethrtime()
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Array addition should not add INDIRECT elements
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$x = 1;
|
||||
$ary = ['y' => 1];
|
||||
$ary += $GLOBALS;
|
||||
var_dump($ary['x']);
|
||||
$x = 2;
|
||||
var_dump($ary['x']);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(1)
|
||||
int(1)
|
||||
@@ -1,10 +0,0 @@
|
||||
--TEST--
|
||||
Add $GLOBALS to itself
|
||||
--FILE--
|
||||
<?php
|
||||
$GLOBALS += $GLOBALS;
|
||||
$x = $GLOBALS + $GLOBALS;
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,15 +0,0 @@
|
||||
--TEST--
|
||||
HT iterator should be destroyed if array becomes empty during array_splice
|
||||
--FILE--
|
||||
<?php
|
||||
$a=[4];
|
||||
$i = 0;
|
||||
foreach ($a as &$r) {
|
||||
var_dump($r);
|
||||
$a = array_splice($a, 0);
|
||||
if (++$i == 2) break;
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
int(4)
|
||||
int(4)
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Assign concat of array and empty string
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = [0];
|
||||
$a .= '';
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Array to string conversion in %s on line %d
|
||||
string(5) "Array"
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Assigning the result of a non-reference function by-reference should not leak
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function func() {
|
||||
return [0];
|
||||
}
|
||||
|
||||
$x = $y =& func();
|
||||
var_dump($x, $y);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Only variables should be assigned by reference in %s on line %d
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
int(0)
|
||||
}
|
||||
@@ -6,7 +6,6 @@ highlight.comment = #FF8000
|
||||
highlight.keyword = #007700
|
||||
highlight.default = #0000BB
|
||||
highlight.html = #000000
|
||||
--WHITESPACE_SENSITIVE--
|
||||
--FILE--
|
||||
<?php
|
||||
$code = '
|
||||
|
||||
@@ -25,8 +25,9 @@ try {
|
||||
--EXPECTF--
|
||||
1. Exception: aaa in %sbug52361.php:5
|
||||
Stack trace:
|
||||
#0 %sbug52361.php(16): aaa->__destruct()
|
||||
#1 {main}
|
||||
#0 %sbug52361.php(13): aaa->__destruct()
|
||||
#1 %sbug52361.php(16): bbb()
|
||||
#2 {main}
|
||||
2. Exception: bbb in %sbug52361.php:13
|
||||
Stack trace:
|
||||
#0 %sbug52361.php(16): bbb()
|
||||
|
||||
@@ -20,7 +20,12 @@ function test() {
|
||||
test();
|
||||
echo "bug\n";
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception: ops 1 in %sbug53511.php:4
|
||||
Fatal error: Uncaught Exception: ops 2 in %sbug53511.php:11
|
||||
Stack trace:
|
||||
#0 %sbug53511.php(17): test()
|
||||
#1 {main}
|
||||
|
||||
Next Exception: ops 1 in %sbug53511.php:4
|
||||
Stack trace:
|
||||
#0 %sbug53511.php(12): Foo->__destruct()
|
||||
#1 %sbug53511.php(17): test()
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace N2 {
|
||||
echo $a->hello(), PHP_EOL;
|
||||
echo $a->foo(), PHP_EOL;
|
||||
try {
|
||||
} catch(namespace\Foo $e)
|
||||
} catch(namespace \Foo $e)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #60161: Implementing an interface extending Traversable is order dependent
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface Foo extends Traversable {
|
||||
}
|
||||
|
||||
class Example implements Foo, IteratorAggregate {
|
||||
public function getIterator() {
|
||||
return new ArrayIterator([]);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -11,12 +11,14 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){
|
||||
require 'notfound.php';
|
||||
--EXPECTF--
|
||||
error(require(notfound.php): failed to open stream: %s)
|
||||
Fatal error: Uncaught Exception: Foo in %sbug60909_1.php:5
|
||||
Warning: Uncaught Exception: Foo in %sbug60909_1.php:5
|
||||
Stack trace:
|
||||
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8, Array)
|
||||
#1 %sbug60909_1.php(8): require()
|
||||
#2 {main}
|
||||
thrown in %sbug60909_1.php on line 5
|
||||
|
||||
Fatal error: main(): Failed opening required 'notfound.php' (include_path='%s') in %sbug60909_1.php on line 8
|
||||
|
||||
|
||||
!!!shutdown!!!
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63206 Fully support error_handler stacking, even inside the error_handler
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'First handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Second handler' . PHP_EOL;
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Internal handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
$triggerInternalNotice++; // warnings while handling the error should go into internal handler
|
||||
|
||||
restore_error_handler();
|
||||
});
|
||||
|
||||
$triggerNotice1++;
|
||||
$triggerNotice2++;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Second handler
|
||||
Internal handler
|
||||
Second handler
|
||||
Internal handler
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63206 Fully support error_handler stacking, even with null
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'First handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Second handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_error_handler(null);
|
||||
|
||||
set_error_handler(function() {
|
||||
echo 'Fourth handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
restore_error_handler();
|
||||
restore_error_handler();
|
||||
|
||||
$triggerNotice++;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Second handler
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63206 Fully support exception_handler stacking, even with null
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_exception_handler(function() {
|
||||
echo 'First handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_exception_handler(function() {
|
||||
echo 'Second handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
set_exception_handler(null);
|
||||
|
||||
set_exception_handler(function() {
|
||||
echo 'Fourth handler' . PHP_EOL;
|
||||
});
|
||||
|
||||
restore_exception_handler();
|
||||
restore_exception_handler();
|
||||
|
||||
throw new Exception();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Second handler
|
||||
@@ -1,45 +0,0 @@
|
||||
--TEST--
|
||||
Bug #63816: implementation child interface and after parent cause fatal error
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface RootInterface
|
||||
{
|
||||
function foo();
|
||||
}
|
||||
|
||||
interface FirstChildInterface extends RootInterface
|
||||
{
|
||||
function foo();
|
||||
}
|
||||
|
||||
interface SecondChildInterface extends RootInterface
|
||||
{
|
||||
function foo();
|
||||
}
|
||||
|
||||
class A implements FirstChildInterface, SecondChildInterface
|
||||
{
|
||||
function foo()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class B implements RootInterface, FirstChildInterface
|
||||
{
|
||||
function foo()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class C implements FirstChildInterface, RootInterface
|
||||
{
|
||||
function foo()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -7,4 +7,4 @@ $x = (new ReflectionFunction("substr"))->getClosure();
|
||||
$x->call(new a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Cannot rebind scope of closure created from function in %s on line %d
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
@@ -14,5 +14,5 @@ var_dump($a);
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
["b"]=>
|
||||
int(2)
|
||||
int(1)
|
||||
}
|
||||
@@ -18,5 +18,5 @@ var_dump($c);
|
||||
Warning: Cannot bind method SplDoublyLinkedList::count() to object of class cls in %s on line %d
|
||||
NULL
|
||||
|
||||
Warning: Cannot rebind scope of closure created from method in %s on line %d
|
||||
Warning: Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure() in %s on line %d
|
||||
NULL
|
||||
@@ -15,6 +15,6 @@ var_dump(parse_ini_file($ini_file));
|
||||
unlink(__DIR__ . "/bug70748.ini");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: syntax error, unexpected end of file, expecting '}' in %sbug70748.ini on line %d
|
||||
Warning: syntax error, unexpected $end, expecting '}' in %sbug70748.ini on line %d
|
||||
in %sbug70748.php on line %d
|
||||
bool(false)
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #73816: Broken eval(anonymous class)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function anon()
|
||||
{
|
||||
static $i = 0;
|
||||
return eval(sprintf('return new class { private $prop%s; };', ++$i));
|
||||
}
|
||||
|
||||
var_dump(anon());
|
||||
var_dump(anon());
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(class@anonymous)#1 (1) {
|
||||
["prop1":"class@anonymous":private]=>
|
||||
NULL
|
||||
}
|
||||
object(class@anonymous)#1 (1) {
|
||||
["prop2":"class@anonymous":private]=>
|
||||
NULL
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
--TEST--
|
||||
Bug #76047: Use-after-free when accessing already destructed backtrace arguments
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Vuln {
|
||||
public $a;
|
||||
public function __destruct() {
|
||||
unset($this->a);
|
||||
$backtrace = (new Exception)->getTrace();
|
||||
var_dump($backtrace);
|
||||
}
|
||||
}
|
||||
|
||||
function test($arg) {
|
||||
$arg = str_shuffle(str_repeat('A', 79));
|
||||
$vuln = new Vuln();
|
||||
$vuln->a = $arg;
|
||||
}
|
||||
|
||||
function test2($arg) {
|
||||
$$arg = 1; // Trigger symbol table
|
||||
$arg = str_shuffle(str_repeat('A', 79));
|
||||
$vuln = new Vuln();
|
||||
$vuln->a = $arg;
|
||||
}
|
||||
|
||||
test('x');
|
||||
test2('x');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["file"]=>
|
||||
string(%d) "%s"
|
||||
["line"]=>
|
||||
int(%d)
|
||||
["function"]=>
|
||||
string(10) "__destruct"
|
||||
["class"]=>
|
||||
string(4) "Vuln"
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
array(1) {
|
||||
[0]=>
|
||||
array(6) {
|
||||
["file"]=>
|
||||
string(%d) "%s"
|
||||
["line"]=>
|
||||
int(%d)
|
||||
["function"]=>
|
||||
string(10) "__destruct"
|
||||
["class"]=>
|
||||
string(4) "Vuln"
|
||||
["type"]=>
|
||||
string(2) "->"
|
||||
["args"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
--TEST--
|
||||
BUG #77589 (Core dump using parse_ini_string with numeric sections)
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(
|
||||
parse_ini_string(<<<INI
|
||||
[0]
|
||||
a = 1
|
||||
b = on
|
||||
c = true
|
||||
|
||||
["true"]
|
||||
a = 100
|
||||
b = null
|
||||
c = yes
|
||||
INI
|
||||
, TRUE, INI_SCANNER_TYPED));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
array(2) {
|
||||
[0]=>
|
||||
array(3) {
|
||||
["a"]=>
|
||||
int(1)
|
||||
["b"]=>
|
||||
bool(true)
|
||||
["c"]=>
|
||||
bool(true)
|
||||
}
|
||||
["true"]=>
|
||||
array(3) {
|
||||
["a"]=>
|
||||
int(100)
|
||||
["b"]=>
|
||||
NULL
|
||||
["c"]=>
|
||||
bool(true)
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78598: Changing array during undef index RW error segfaults
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$my_var = null;
|
||||
set_error_handler(function() use(&$my_var) {
|
||||
$my_var = 0;
|
||||
});
|
||||
|
||||
$my_var[0] .= "xyz";
|
||||
var_dump($my_var);
|
||||
|
||||
$my_var = null;
|
||||
$my_var[0][0][0] .= "xyz";
|
||||
var_dump($my_var);
|
||||
|
||||
$my_var = null;
|
||||
$my_var["foo"] .= "xyz";
|
||||
var_dump($my_var);
|
||||
|
||||
$my_var = null;
|
||||
$my_var["foo"]["bar"]["baz"] .= "xyz";
|
||||
var_dump($my_var);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
int(0)
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78776: Abstract method implementation from trait does not check "static"
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
abstract class A
|
||||
{
|
||||
abstract public function createApp();
|
||||
}
|
||||
|
||||
class B extends A
|
||||
{
|
||||
use C;
|
||||
}
|
||||
|
||||
trait C
|
||||
{
|
||||
public static function createApp()
|
||||
{
|
||||
echo "You should not be here\n";
|
||||
}
|
||||
}
|
||||
|
||||
B::createApp();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Cannot make non static method A::createApp() static in class C in %s on line %d
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78921: When Reflection triggers class load, property visibility is incorrect
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($className) {
|
||||
if ($className == 'PrivateStatic') {
|
||||
class PrivateStatic
|
||||
{
|
||||
const SOME_CONST = 13;
|
||||
private static $privateStaticVarArray = ['a', 'b', 'c'];
|
||||
private static $otherStatic;
|
||||
public static function init()
|
||||
{
|
||||
self::$otherStatic = self::$privateStaticVarArray;
|
||||
}
|
||||
}
|
||||
PrivateStatic::init();
|
||||
}
|
||||
});
|
||||
|
||||
class OtherClass
|
||||
{
|
||||
const MY_CONST = PrivateStatic::SOME_CONST;
|
||||
public static $prop = 'my property';
|
||||
}
|
||||
|
||||
$reflectionClass = new ReflectionClass('OtherClass');
|
||||
$reflectionProperty = $reflectionClass->getProperty('prop');
|
||||
$reflectionProperty->setAccessible(true);
|
||||
$value = $reflectionProperty->getValue();
|
||||
echo "Value is $value\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Value is my property
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78973: Destructor during CV freeing causes segfault if opline never saved
|
||||
--INI--
|
||||
opcache.optimization_level=0
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test($x) {
|
||||
}
|
||||
test(new class {
|
||||
public function __destruct() {
|
||||
debug_print_backtrace();
|
||||
}
|
||||
});
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
#0 class@anonymous->__destruct() called at [%s:%d]
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78999 (Cycle leak when using function result as temporary)
|
||||
--FILE--
|
||||
<?php
|
||||
function get() {
|
||||
$t = new stdClass;
|
||||
$t->prop = $t;
|
||||
return $t;
|
||||
}
|
||||
var_dump(get());
|
||||
var_dump(gc_collect_cycles());
|
||||
--EXPECT--
|
||||
object(stdClass)#1 (1) {
|
||||
["prop"]=>
|
||||
*RECURSION*
|
||||
}
|
||||
int(1)
|
||||
@@ -1,39 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79022 (class_exists returns True for classes that are not ready to be used)
|
||||
--FILE--
|
||||
<?php
|
||||
function my_autoloader($class) {
|
||||
if (class_exists('Foo', 0)) {
|
||||
new Foo();
|
||||
}
|
||||
if ($class == 'Foo') {
|
||||
eval("class Foo extends Bar{}");
|
||||
}
|
||||
|
||||
if ($class == 'Bar') {
|
||||
eval("class Bar {}");
|
||||
}
|
||||
|
||||
if ($class == 'Dummy') {
|
||||
eval ("class Dummy implements iFoo {}");
|
||||
}
|
||||
|
||||
|
||||
if (interface_exists('iFoo', 0)) {
|
||||
new Dummy();
|
||||
}
|
||||
if ($class == 'iFoo') {
|
||||
eval ("interface iFoo extends iBar {}");
|
||||
}
|
||||
|
||||
if ($class == 'iBar') {
|
||||
eval ("interface iBar {}");
|
||||
}
|
||||
}
|
||||
spl_autoload_register('my_autoloader');
|
||||
new Foo();
|
||||
new Dummy();
|
||||
echo "okey";
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
||||
@@ -1,36 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79155: Property nullability lost when using multiple property definition
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Foo {
|
||||
public ?string $a, $b;
|
||||
public ?stdClass $c, $d;
|
||||
}
|
||||
|
||||
$t = new Foo;
|
||||
$t->a = "str";
|
||||
$t->b = "str";
|
||||
$t->c = new stdClass;
|
||||
$t->d = new stdClass;
|
||||
|
||||
var_dump($t->a, $t->b, $t->c, $t->d);
|
||||
|
||||
$t->a = null;
|
||||
$t->b = null;
|
||||
$t->c = null;
|
||||
$t->d = null;
|
||||
var_dump($t->a, $t->b, $t->c, $t->d);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(3) "str"
|
||||
string(3) "str"
|
||||
object(stdClass)#2 (0) {
|
||||
}
|
||||
object(stdClass)#3 (0) {
|
||||
}
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79364 (When copy empty array, next key is unspecified)
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [1, 2];
|
||||
unset($a[1], $a[0]);
|
||||
$b = $a;
|
||||
|
||||
$a[] = 3;
|
||||
$b[] = 4;
|
||||
|
||||
var_dump($a, $b);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(3)
|
||||
}
|
||||
array(1) {
|
||||
[2]=>
|
||||
int(4)
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79477: casting object into array creates references
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public $prop = 'default value';
|
||||
}
|
||||
|
||||
$obj = new Test;
|
||||
$obj->{1} = null;
|
||||
|
||||
$arr = (array) $obj;
|
||||
$arr['prop'] = 'new value';
|
||||
|
||||
echo $obj->prop, "\n";
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
default value
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79514 (Memory leaks while including unexistent file)
|
||||
--FILE--
|
||||
<?php
|
||||
$mem1 = memory_get_usage(true);
|
||||
for ($i = 0; $i < 100000; $i++) {
|
||||
@include __DIR__ . '/bug79514.doesnotexist';
|
||||
}
|
||||
$mem2 = memory_get_usage(true);
|
||||
var_dump($mem2 - $mem1 < 100000);
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79599 (coredump in set_error_handler)
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler(function($code, $message){
|
||||
throw new \Exception($message);
|
||||
});
|
||||
function test1(){
|
||||
$a[] = $b;
|
||||
}
|
||||
function test2(){
|
||||
$a[$c] = $b;
|
||||
}
|
||||
try{
|
||||
test1();
|
||||
}catch(\Exception $e){
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
try{
|
||||
test2();
|
||||
}catch(\Exception $e){
|
||||
var_dump($e->getMessage());
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
string(21) "Undefined variable: b"
|
||||
string(21) "Undefined variable: b"
|
||||
@@ -1,42 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79657: "yield from" hangs when invalid value encountered
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function throwException(): iterable
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
function loop(): iterable
|
||||
{
|
||||
$callbacks = [
|
||||
function () {
|
||||
yield 'first';
|
||||
},
|
||||
function () {
|
||||
yield from throwException();
|
||||
}
|
||||
];
|
||||
|
||||
foreach ($callbacks as $callback) {
|
||||
yield from $callback();
|
||||
}
|
||||
}
|
||||
|
||||
function get(string $first, int $second): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
get(...loop());
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Exception in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): throwException()
|
||||
#1 %s(%d): {closure}()
|
||||
#2 %s(%d): loop()
|
||||
#3 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79668 (get_defined_functions(true) may miss functions)
|
||||
--INI--
|
||||
disable_functions=sha1_file,password_hash
|
||||
--FILE--
|
||||
<?php
|
||||
$df = get_defined_functions(true);
|
||||
foreach (['sha1', 'sha1_file', 'hash', 'password_hash'] as $funcname) {
|
||||
var_dump(in_array($funcname, $df['internal'], true));
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
bool(false)
|
||||
bool(true)
|
||||
bool(false)
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79740: serialize() and unserialize() methods can not be called statically
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
public function serialize() { }
|
||||
public function unserialize() { }
|
||||
}
|
||||
|
||||
var_dump(is_callable(['A', 'serialize']));
|
||||
var_dump(is_callable(['A', 'unserialize']));
|
||||
A::serialize();
|
||||
A::unserialize();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(true)
|
||||
bool(true)
|
||||
|
||||
Deprecated: Non-static method A::serialize() should not be called statically in %s on line %d
|
||||
|
||||
Deprecated: Non-static method A::unserialize() should not be called statically in %s on line %d
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79778: Assertion failure if dumping closure with unresolved static variable
|
||||
--FILE--
|
||||
<?php
|
||||
$closure1 = function() {
|
||||
static $var = CONST_REF;
|
||||
};
|
||||
var_dump($closure1);
|
||||
print_r($closure1);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(Closure)#1 (1) {
|
||||
["static"]=>
|
||||
array(1) {
|
||||
["var"]=>
|
||||
string(14) "<constant ast>"
|
||||
}
|
||||
}
|
||||
Closure Object
|
||||
(
|
||||
[static] => Array
|
||||
(
|
||||
[var] => <constant ast>
|
||||
)
|
||||
|
||||
)
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79779: Assertion failure when assigning property of string offset by reference
|
||||
--FILE--
|
||||
<?php
|
||||
$str = "";
|
||||
$str[1]->a = &$b;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot use string offset as an object in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,11 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79783: Segfault in php_str_replace_common
|
||||
--FILE--
|
||||
<?php
|
||||
str_replace("a", "b", "c", strlen("d"));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot pass parameter 4 by reference in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79784: Use after free if changing array during undef var during array write fetch
|
||||
--FILE--
|
||||
<?php
|
||||
set_error_handler(function () {
|
||||
$GLOBALS['a'] = null;
|
||||
});
|
||||
|
||||
$a[$c] = 'x' ;
|
||||
var_dump($a);
|
||||
$a[$c] .= 'x' ;
|
||||
var_dump($a);
|
||||
$a[$c][$c] = 'x' ;
|
||||
var_dump($a);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79792: HT iterators not removed if empty array is destroyed
|
||||
--FILE--
|
||||
<?php
|
||||
$a = [42];
|
||||
foreach ($a as &$c) {
|
||||
// Make the array empty.
|
||||
unset($a[0]);
|
||||
// Destroy the array.
|
||||
$a = null;
|
||||
}
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECTF--
|
||||
Warning: Invalid argument supplied for foreach() in %s on line %d
|
||||
===DONE===
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79793: Use after free if string used in undefined index warning is changed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$key = "foo";
|
||||
$key .= "bar";
|
||||
set_error_handler(function($_, $m) use (&$key) {
|
||||
echo "$m\n";
|
||||
$key .= "baz";
|
||||
});
|
||||
|
||||
$ary = [];
|
||||
$ary[$key]++;
|
||||
var_dump($ary);
|
||||
$ary[$key] += 1;
|
||||
var_dump($ary);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Undefined index: foobar
|
||||
array(1) {
|
||||
["foobar"]=>
|
||||
int(1)
|
||||
}
|
||||
Undefined index: foobarbaz
|
||||
array(2) {
|
||||
["foobar"]=>
|
||||
int(1)
|
||||
["foobarbaz"]=>
|
||||
int(1)
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79862: Public non-static property in child should take priority over private static
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class a {
|
||||
private static $prop1;
|
||||
private static $prop2;
|
||||
private $prop3;
|
||||
private $prop4;
|
||||
private static $prop5;
|
||||
private static $prop6;
|
||||
public function __construct() {
|
||||
$this->prop1 = 1;
|
||||
$this->prop2 = 2;
|
||||
$this->prop3 = 3;
|
||||
$this->prop4 = 4;
|
||||
$this->prop5 = 5;
|
||||
$this->prop6 = 6;
|
||||
var_dump(self::$prop1);
|
||||
var_dump(self::$prop2);
|
||||
var_dump(self::$prop5);
|
||||
var_dump(self::$prop6);
|
||||
var_dump($this);
|
||||
}
|
||||
}
|
||||
class c extends a {
|
||||
public $prop1;
|
||||
protected $prop2;
|
||||
public static $prop3;
|
||||
protected static $prop4;
|
||||
public static $prop5;
|
||||
protected static $prop6;
|
||||
}
|
||||
|
||||
$c = new c;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Accessing static property c::$prop5 as non static in %s on line %d
|
||||
|
||||
Notice: Accessing static property c::$prop6 as non static in %s on line %d
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
NULL
|
||||
object(c)#1 (6) {
|
||||
["prop1"]=>
|
||||
int(1)
|
||||
["prop2":protected]=>
|
||||
int(2)
|
||||
["prop3":"a":private]=>
|
||||
int(3)
|
||||
["prop4":"a":private]=>
|
||||
int(4)
|
||||
["prop5"]=>
|
||||
int(5)
|
||||
["prop6"]=>
|
||||
int(6)
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79919 (Stack use-after-scope in define())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('simplexml')) die('skip simplexml extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$b = error_log(0);
|
||||
$b = simplexml_load_string('<xml/>', null, $b);
|
||||
define(0, $b);
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
@@ -1,29 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79934: CRLF-only line in heredoc causes parsing error
|
||||
--DESCRIPTION--
|
||||
This test covers different variations of whitespace-only lines in heredoc strings.
|
||||
These whitespace-only lines should be ignored when stripping indentation.
|
||||
--FILE--
|
||||
<?php
|
||||
// lines with only CRLF should not cause a parse error
|
||||
eval("\$s1 = <<<HEREDOC\r\n a\r\n\r\n b\r\n HEREDOC;");
|
||||
var_dump(addcslashes($s1, "\r\n"));
|
||||
|
||||
// lines with only a LF should not cause a parse error
|
||||
eval("\$s2 = <<<HEREDOC\n a\n\n b\n HEREDOC;");
|
||||
var_dump(addcslashes($s2, "\n"));
|
||||
|
||||
// lines with only a CR should not cause a parse error
|
||||
eval("\$s3 = <<<HEREDOC\r a\r\r b\r HEREDOC;");
|
||||
var_dump(addcslashes($s3, "\r"));
|
||||
|
||||
// lines with only whitespace should not cause a parse error
|
||||
eval("\$s4 = <<<HEREDOC\r a\r\n \r\n b\r HEREDOC;");
|
||||
var_dump(addcslashes($s4, "\n\r"));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(10) "a\r\n\r\nb"
|
||||
string(6) "a\n\nb"
|
||||
string(6) "a\r\rb"
|
||||
string(10) "a\r\n\r\nb"
|
||||
@@ -1,13 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79947: Memory leak on invalid offset type in compound assignment
|
||||
--FILE--
|
||||
<?php
|
||||
$array = [];
|
||||
$key = [];
|
||||
$array[$key] += [$key];
|
||||
var_dump($array);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Illegal offset type in %s on line %d
|
||||
array(0) {
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79979 (passing value to by-ref param via CUF(A) crashes)
|
||||
--FILE--
|
||||
<?php
|
||||
call_user_func_array("str_replace", ["a", "b", "c", 0]);
|
||||
|
||||
$cufa = "call_user_func_array";
|
||||
$cufa("str_replace", ["a", "b", "c", 0]);
|
||||
|
||||
call_user_func_array($cufa, ["str_replace", ["a", "b", "c", 0]]);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Parameter 4 to str_replace() expected to be a reference, value given in %s on line %d
|
||||
|
||||
Warning: Parameter 4 to str_replace() expected to be a reference, value given in %s on line %d
|
||||
|
||||
Warning: Parameter 4 to str_replace() expected to be a reference, value given in %s on line %d
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80037: Typed property must not be accessed before initialization when __get() declared
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
final class A
|
||||
{
|
||||
public string $a;
|
||||
|
||||
public static function fromArray(array $props): self
|
||||
{
|
||||
$me = new static;
|
||||
foreach ($props as $k => &$v) {
|
||||
$me->{$k} = &$v; # try to remove &
|
||||
}
|
||||
return $me;
|
||||
}
|
||||
|
||||
public function __get($name)
|
||||
{
|
||||
throw new \LogicException("Property '$name' is not defined.");
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(A::fromArray(['a' => 'foo']));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(A)#1 (1) {
|
||||
["a"]=>
|
||||
string(3) "foo"
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80046: FREE for SWITCH_STRING optimized away
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test($foo) {
|
||||
switch ($foo . 'Bar') {
|
||||
case 'A':
|
||||
throw new Exception('A');
|
||||
default:
|
||||
throw new Exception('Default');
|
||||
}
|
||||
}
|
||||
try {
|
||||
test('Foo');
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Default
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80049: Memleak when coercing integers to string via variadic argument
|
||||
--FILE--
|
||||
<?php
|
||||
function coerceToString(string ...$strings) {
|
||||
var_dump($strings);
|
||||
}
|
||||
coerceToString(...[123]);
|
||||
?>
|
||||
--EXPECT--
|
||||
array(1) {
|
||||
[0]=>
|
||||
string(3) "123"
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80126: Covariant return types failing compilation
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface I {
|
||||
public function method(): I;
|
||||
}
|
||||
|
||||
abstract class A implements I {
|
||||
public function method(): I { }
|
||||
}
|
||||
|
||||
class C extends A { }
|
||||
|
||||
class C2 extends C {
|
||||
public function method(): C2 { }
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80126: Covariant return types failing compilation (variation 2)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
interface I {
|
||||
public function method(): I;
|
||||
}
|
||||
|
||||
abstract class A implements I {
|
||||
public function method(): I {
|
||||
return new static();
|
||||
}
|
||||
}
|
||||
|
||||
class C extends A { }
|
||||
|
||||
interface I2 { }
|
||||
|
||||
class C2 extends C implements I2 {
|
||||
public function method(): C2 { }
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80194: Assertion failure during block assembly of unreachable free with leading nop
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test($x) {
|
||||
switch ($x->y) {
|
||||
default:
|
||||
throw new Exception;
|
||||
case 'foobar':
|
||||
return new stdClass();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$x = (object)['y' => 'foobar'];
|
||||
var_dump(test($x));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#2 (0) {
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80781: Error handler that throws ErrorException infinite loop
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function handle(int $severity, string $message, string $file, int $line): bool {
|
||||
if((error_reporting() & $severity) !== 0) {
|
||||
throw new \ErrorException($message, 0, $severity, $file, $line);
|
||||
}
|
||||
|
||||
return true; // stfu operator
|
||||
}
|
||||
|
||||
set_error_handler('handle');
|
||||
|
||||
function getPlugin(string $plugin) : bool{
|
||||
return false;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$array = [];
|
||||
if (isset($array[$data]) or getPlugin($data)) {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught ErrorException: Illegal offset type in isset or empty in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): handle(2, 'Illegal offset ...', %s, %d, Array)
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,41 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80972: Memory exhaustion on invalid string offset
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function exceptions_error_handler($severity, $message, $filename, $lineno) {
|
||||
if (error_reporting() & $severity) {
|
||||
throw new ErrorException($message, 0, $severity, $filename, $lineno);
|
||||
}
|
||||
}
|
||||
set_error_handler('exceptions_error_handler');
|
||||
|
||||
$float = 10e120;
|
||||
$string_float = (string) $float;
|
||||
|
||||
$string = 'Here is some text for good measure';
|
||||
|
||||
try {
|
||||
echo 'Float casted to string compile', \PHP_EOL;
|
||||
$string[(string) 10e120] = 'E';
|
||||
var_dump($string);
|
||||
} catch (\Throwable $e) {
|
||||
echo $e->getMessage(), \PHP_EOL;
|
||||
}
|
||||
|
||||
/* This same bug also permits to modify the first byte of a string even if
|
||||
* the offset is invalid */
|
||||
try {
|
||||
/* This must not affect the string value */
|
||||
$string["wrong"] = "f";
|
||||
} catch (\Throwable $e) {
|
||||
echo $e->getMessage() . \PHP_EOL;
|
||||
}
|
||||
var_dump($string);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Float casted to string compile
|
||||
Illegal string offset '1.0E+121'
|
||||
Illegal string offset 'wrong'
|
||||
string(34) "Here is some text for good measure"
|
||||
@@ -9,7 +9,6 @@ namespace {
|
||||
|
||||
var_dump(FOO); // Ok
|
||||
var_dump(foo); // Deprecated
|
||||
var_dump(\foo); // Deprecated
|
||||
|
||||
var_dump(NS\FOO); // Ok
|
||||
var_dump(ns\FOO); // Ok
|
||||
@@ -73,13 +72,10 @@ int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 8
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 9
|
||||
int(42)
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 13
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 12
|
||||
int(24)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -88,24 +84,24 @@ bool(true)
|
||||
bool(true)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 22
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 21
|
||||
int(42)
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 25
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 24
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 30
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 29
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 35
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 34
|
||||
int(24)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 40
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 39
|
||||
int(42)
|
||||
bool(true)
|
||||
bool(true)
|
||||
@@ -114,18 +110,18 @@ bool(true)
|
||||
bool(true)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 49
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 48
|
||||
int(42)
|
||||
int(24)
|
||||
int(24)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 52
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "NS\FOO" in %s on line 51
|
||||
int(24)
|
||||
int(42)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 56
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 55
|
||||
int(42)
|
||||
int(43)
|
||||
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 60
|
||||
Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "FOO" in %s on line 59
|
||||
int(43)
|
||||
+12
-12
@@ -118,10 +118,10 @@ bindTo(new Cls, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Cannot rebind scope of closure created from function
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Cannot rebind scope of closure created from function
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, stdClass::class):
|
||||
Cannot bind closure to scope of internal class stdClass
|
||||
@@ -139,10 +139,10 @@ bindTo(new Cls, null):
|
||||
Success!
|
||||
|
||||
bindTo(new Cls, Cls::class):
|
||||
Cannot rebind scope of closure created from function
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, Cls::class):
|
||||
Cannot rebind scope of closure created from function
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, stdClass::class):
|
||||
Cannot bind closure to scope of internal class stdClass
|
||||
@@ -163,13 +163,13 @@ bindTo(new Cls, Cls::class):
|
||||
Cannot bind an instance to a static closure
|
||||
|
||||
bindTo(null, null):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, ClsChild::class):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(null, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
(new Cls)->method()
|
||||
-------------------
|
||||
@@ -189,13 +189,13 @@ bindTo(new ClsUnrelated, Cls::class):
|
||||
Cannot bind method Cls::method() to object of class ClsUnrelated
|
||||
|
||||
bindTo(new Cls, null):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(new Cls, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(new Cls, ClsChild::class):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
(new SplDoublyLinkedList)->count()
|
||||
----------------------------------
|
||||
@@ -216,10 +216,10 @@ bindTo(null, SplDoublyLinkedList::class):
|
||||
Cannot unbind $this of internal method
|
||||
|
||||
bindTo(new SplDoublyLinkedList, null):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
bindTo(new SplDoublyLinkedList, ClsUnrelated::class):
|
||||
Cannot rebind scope of closure created from method
|
||||
Cannot rebind scope of closure created by ReflectionFunctionAbstract::getClosure()
|
||||
|
||||
(function() {})()
|
||||
-----------------
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
--TEST--
|
||||
Cannot write to closure properties
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class A {
|
||||
function getFn() {
|
||||
return function() {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A;
|
||||
try {
|
||||
$c = $a->getFn()->b = new stdClass;
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Closure object cannot have properties
|
||||
@@ -1,56 +0,0 @@
|
||||
--TEST--
|
||||
Bug #80929: Method name corruption related to zend_closure_call_magic
|
||||
--FILE--
|
||||
<?php
|
||||
class DefaultListener
|
||||
{
|
||||
public function handleDefaultEvent($event) { }
|
||||
}
|
||||
|
||||
class SubscriberProxy
|
||||
{
|
||||
private array $subscribedEvents;
|
||||
private object $subscriber;
|
||||
private Closure $listener;
|
||||
|
||||
public function __construct(array $subscribedEvents, object $subscriber)
|
||||
{
|
||||
$this->subscribedEvents = $subscribedEvents;
|
||||
$this->subscriber = $subscriber;
|
||||
foreach ($this->subscribedEvents as $eventName => $params) {
|
||||
$this->listener = Closure::fromCallable([$this, $params]);
|
||||
}
|
||||
}
|
||||
|
||||
public function __call(string $name, array $arguments)
|
||||
{
|
||||
return $this->subscriber->$name(...$arguments);
|
||||
}
|
||||
|
||||
public function dispatch($event, string $eventName)
|
||||
{
|
||||
($this->listener)($event, $eventName, null);
|
||||
}
|
||||
}
|
||||
|
||||
$proxy = new SubscriberProxy(
|
||||
['defaultEvent' => 'handleDefaultEvent'],
|
||||
new DefaultListener()
|
||||
);
|
||||
|
||||
for ($i = 0; $i < 10; $i++) {
|
||||
echo $i . PHP_EOL;
|
||||
$proxy->dispatch(null, 'defaultEvent');
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Make sure type inference upholds invariants for dead arrays
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
foreach ($a as $v) {
|
||||
$b[] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: a in %s on line %d
|
||||
|
||||
Warning: Invalid argument supplied for foreach() in %s on line %d
|
||||
@@ -1,28 +0,0 @@
|
||||
--TEST--
|
||||
Freeing of function "name" when dynamic call fails
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
$bar = "bar";
|
||||
("foo" . $bar)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
$bar = ["bar"];
|
||||
(["foo"] + $bar)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
(new stdClass)();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Call to undefined function foobar()
|
||||
Function name must be a string
|
||||
Function name must be a string
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
EX(func) can be null during write_property in an edge case
|
||||
--FILE--
|
||||
<?php
|
||||
class a {
|
||||
public static $i = 0;
|
||||
function __destruct() {
|
||||
if (self::$i++ != 0) throw new Exception;
|
||||
$b = new a;
|
||||
echo $b;
|
||||
}
|
||||
}
|
||||
new a;
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Object of class a could not be converted to string in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): a->__destruct()
|
||||
#1 {main}
|
||||
|
||||
Next Exception in %s:%d
|
||||
Stack trace:
|
||||
#0 %s(%d): a->__destruct()
|
||||
#1 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,23 +0,0 @@
|
||||
--TEST--
|
||||
Exception thrown by __get() during =& assignment
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
private $x;
|
||||
public function &__get($name) {
|
||||
throw new Exception("Foobar");
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
$y = 5;
|
||||
try {
|
||||
$test->x =& $y;
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Foobar
|
||||
@@ -1,41 +0,0 @@
|
||||
--TEST--
|
||||
Make sure exceptions during include/require stating are properly propagated
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class StreamWrapper {
|
||||
public function url_stat($path, $flags) {
|
||||
throw new Exception('stat failed');
|
||||
}
|
||||
}
|
||||
|
||||
stream_wrapper_register('test', StreamWrapper::class);
|
||||
set_include_path('test://foo:test://bar');
|
||||
|
||||
try {
|
||||
require_once 'doesnt_exist.php';
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
require 'doesnt_exist.php';
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
include_once 'doesnt_exist.php';
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
include 'doesnt_exist.php';
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
stat failed
|
||||
stat failed
|
||||
stat failed
|
||||
stat failed
|
||||
@@ -1,20 +0,0 @@
|
||||
--TEST--
|
||||
Leak when setting recursive previous exception in finally handling
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
try {
|
||||
throw new Exception("Test");
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
} finally {
|
||||
throw $e;
|
||||
}
|
||||
} catch (Exception $e2) {
|
||||
echo $e2->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Test
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
FE_FETCH op2 is a def and needs special live range handling
|
||||
--FILE--
|
||||
<?php
|
||||
try {
|
||||
foreach (["test"] as $k => func()[]) {}
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Call to undefined function func()
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Bug #78434: Generator skips first item after valid() call
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$function = function () {
|
||||
yield 0;
|
||||
};
|
||||
|
||||
$wrapper = function () use ($function) {
|
||||
$generator = $function();
|
||||
$generator->valid();
|
||||
yield from $generator;
|
||||
|
||||
$generator = $function();
|
||||
$generator->valid();
|
||||
yield from $generator;
|
||||
};
|
||||
|
||||
foreach ($wrapper() as $value) {
|
||||
echo $value, "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
0
|
||||
0
|
||||
@@ -1,24 +0,0 @@
|
||||
--TEST--
|
||||
Bug #79600: Regression in 7.4.6 when yielding an array based generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function createArrayGenerator() {
|
||||
yield from [
|
||||
1,
|
||||
2,
|
||||
];
|
||||
}
|
||||
|
||||
function createGeneratorFromArrayGenerator() {
|
||||
yield from createArrayGenerator();
|
||||
}
|
||||
|
||||
foreach (createGeneratorFromArrayGenerator() as $value) {
|
||||
echo $value, "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
1
|
||||
2
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Generator exceptions during shutdown should not be swallowed
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
try {
|
||||
echo "before yield\n";
|
||||
yield;
|
||||
echo "after yield\n";
|
||||
} finally {
|
||||
echo "before yield in finally\n";
|
||||
yield;
|
||||
echo "after yield in finally\n";
|
||||
}
|
||||
echo "after finally\n";
|
||||
}
|
||||
|
||||
$gen = gen();
|
||||
$gen->rewind();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
before yield
|
||||
before yield in finally
|
||||
|
||||
Fatal error: Uncaught Error: Cannot yield from finally in a force-closed generator in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,25 +0,0 @@
|
||||
--TEST--
|
||||
GC on running generator
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield;
|
||||
// Trigger GC while $v is being reassigned.
|
||||
$ary = [new stdClass, new stdClass, new stdClass];
|
||||
$ary[0]->foo = $ary;
|
||||
foreach ($ary as &$v) { }
|
||||
}
|
||||
|
||||
for ($i = 0; $i < 10000; $i++) {
|
||||
// Make sure gen is registered as a GC root.
|
||||
$gen = gen();
|
||||
$gen2 = $gen;
|
||||
unset($gen);
|
||||
foreach ($gen2 as $v) {}
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -10,6 +10,9 @@ function from($levels) {
|
||||
}
|
||||
|
||||
function gen($gen, $level) {
|
||||
if ($level % 2) {
|
||||
yield $gen->current();
|
||||
}
|
||||
yield from $gen;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--TEST--
|
||||
Yield from non-iterable
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function gen() {
|
||||
yield from new stdClass;
|
||||
}
|
||||
|
||||
try {
|
||||
gen()->current();
|
||||
} catch (Error $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Can use "yield from" only with arrays and Traversables
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Exception from valid() during yield from
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class FooBar implements Iterator {
|
||||
function rewind() {}
|
||||
function current() {}
|
||||
function key() {}
|
||||
function next() {}
|
||||
function valid() {
|
||||
throw new Exception("Exception from valid()");
|
||||
}
|
||||
}
|
||||
|
||||
function gen() {
|
||||
try {
|
||||
// the fact that the yield from result is used is relevant.
|
||||
var_dump(yield from new FooBar);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$x = gen();
|
||||
$x->current();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Exception from valid()
|
||||
@@ -1,51 +0,0 @@
|
||||
--TEST--
|
||||
Free pending exceptions / return values on clone on yield in finally
|
||||
--FILE--
|
||||
<?php
|
||||
function gen1() {
|
||||
try {
|
||||
throw new Exception();
|
||||
} finally {
|
||||
yield;
|
||||
}
|
||||
}
|
||||
function gen2() {
|
||||
try {
|
||||
$bar = "bar";
|
||||
return "foo" . $bar;
|
||||
} finally {
|
||||
yield;
|
||||
}
|
||||
}
|
||||
function gen3() {
|
||||
try {
|
||||
throw new Exception();
|
||||
} finally {
|
||||
try {
|
||||
$bar = "bar";
|
||||
return "foo" . $bar;
|
||||
} finally {
|
||||
yield;
|
||||
}
|
||||
}
|
||||
}
|
||||
function gen4() {
|
||||
try {
|
||||
try {
|
||||
$bar = "bar";
|
||||
return "foo" . $bar;
|
||||
} finally {
|
||||
yield;
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
gen1()->rewind();
|
||||
gen2()->rewind();
|
||||
gen3()->rewind();
|
||||
gen4()->rewind();
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,30 +0,0 @@
|
||||
--TEST--
|
||||
Stats executed during include path resolution should be silent
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class StreamWrapper {
|
||||
public function url_stat($path, $flags) {
|
||||
$path = str_replace('test://', 'file://', $path);
|
||||
if ($flags & STREAM_URL_STAT_QUIET) {
|
||||
return @stat($path);
|
||||
} else {
|
||||
return stat($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stream_wrapper_register('test', StreamWrapper::class);
|
||||
set_include_path('test://foo:test://bar');
|
||||
|
||||
try {
|
||||
require_once 'doesnt_exist.php';
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: require_once(doesnt_exist.php): failed to open stream: No such file or directory in %s on line %d
|
||||
|
||||
Fatal error: require_once(): Failed opening required 'doesnt_exist.php' (include_path='test://foo:test://bar') in %s on line %d
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
is_callable() with trampoline should not caused UAF
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class B {}
|
||||
class A extends B {
|
||||
public function bar($func) {
|
||||
var_dump(is_callable(array('parent', 'foo')));
|
||||
}
|
||||
|
||||
public function __call($func, $args) {
|
||||
}
|
||||
}
|
||||
|
||||
class X {
|
||||
public static function __callStatic($func, $args) {
|
||||
}
|
||||
}
|
||||
|
||||
$a = new A();
|
||||
// Extra X::foo() wrapper to force use of allocated trampoline.
|
||||
X::foo($a->bar('foo'));
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
String offset error during list() by-ref assignment
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$a = [0];
|
||||
$v = 'b';
|
||||
$i = 0;
|
||||
list(&$a[$i++]) = $v;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught Error: Cannot create references to/from string offsets in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
thrown in %s on line %d
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Missing live range if part of phi
|
||||
--FILE--
|
||||
<?php
|
||||
function doThrow() {
|
||||
throw new Exception("Test");
|
||||
}
|
||||
function test($k) {
|
||||
// The 0 gives the QM_ASSIGN a non-refcounted type.
|
||||
$res[$k ? $k : 0] = doThrow();
|
||||
}
|
||||
try {
|
||||
test(new stdClass);
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Test
|
||||
@@ -6,7 +6,6 @@ highlight.comment = #FF8000
|
||||
highlight.keyword = #007700
|
||||
highlight.default = #0000BB
|
||||
highlight.html = #000000
|
||||
--WHITESPACE_SENSITIVE--
|
||||
--FILE--
|
||||
<?php
|
||||
$code = <<<'EOF'
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Make sure the return value of a property assignment is not freed to early
|
||||
--FILE--
|
||||
<?php
|
||||
class Overloaded {
|
||||
function __set($r, $a) {}
|
||||
}
|
||||
$obj = new Overloaded;
|
||||
$x = $obj->prop = new stdClass;
|
||||
var_dump($x);
|
||||
?>
|
||||
--EXPECT--
|
||||
object(stdClass)#2 (0) {
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Test property guard hash value assumption
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
function __get($var) {
|
||||
return $this->{$var.''};
|
||||
}
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
var_dump($test->x);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined property: Test::$x in %s on line %d
|
||||
NULL
|
||||
@@ -1,14 +0,0 @@
|
||||
--TEST--
|
||||
Regression test for incorrect update of pi node users when removing a predecessor block
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function test() {
|
||||
for (; $n--; )
|
||||
C;
|
||||
}
|
||||
test();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Undefined variable: n in %s on line %d
|
||||
@@ -1,16 +0,0 @@
|
||||
--TEST--
|
||||
Accessing PHP_INT_MAX and PHP_INT_MIN as string offsets
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$str = "";
|
||||
var_dump($str[PHP_INT_MAX]);
|
||||
var_dump($str[PHP_INT_MIN]);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Notice: Uninitialized string offset: %d in %s on line %d
|
||||
string(0) ""
|
||||
|
||||
Notice: Uninitialized string offset: -%d in %s on line %d
|
||||
string(0) ""
|
||||
@@ -1,19 +0,0 @@
|
||||
--TEST--
|
||||
Symtable cache slots may be acquired while cleaning symtable
|
||||
--FILE--
|
||||
<?php
|
||||
class A {
|
||||
// Must be larger than the symtable cache.
|
||||
static $max = 40;
|
||||
function __destruct() {
|
||||
if (self::$max-- < 0) return;
|
||||
$x = 'y';
|
||||
$$x = new a;
|
||||
}
|
||||
}
|
||||
new A;
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
CONST/CV should not be freed on failed reference assignment
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public ?Type $prop;
|
||||
}
|
||||
$obj = new Test;
|
||||
$ref =& $obj->prop;
|
||||
try {
|
||||
$ref = [1];
|
||||
} catch (TypeError $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
try {
|
||||
$ary = [1];
|
||||
$ref = $ary;
|
||||
} catch (TypeError $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
var_dump($ref);
|
||||
?>
|
||||
--EXPECT--
|
||||
Cannot assign array to reference held by property Test::$prop of type ?Type
|
||||
Cannot assign array to reference held by property Test::$prop of type ?Type
|
||||
NULL
|
||||
@@ -1,26 +0,0 @@
|
||||
--TEST--
|
||||
Assigning stringable object to static string property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test1 {
|
||||
public static $ref;
|
||||
}
|
||||
class Test2 {
|
||||
public string $str = "str";
|
||||
}
|
||||
class Test3 {
|
||||
public function __toString() {
|
||||
$x = "foo";
|
||||
return $x . "bar";
|
||||
}
|
||||
}
|
||||
|
||||
$test2 = new Test2;
|
||||
Test1::$ref =& $test2->str;
|
||||
Test1::$ref = new Test3;
|
||||
var_dump(Test1::$ref);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(6) "foobar"
|
||||
@@ -1,47 +0,0 @@
|
||||
--TEST--
|
||||
Variable assignment in catch must respect typed references
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test {
|
||||
public int $i = 42;
|
||||
public string $s = "str";
|
||||
}
|
||||
|
||||
$test = new Test;
|
||||
|
||||
$ref =& $test->i;
|
||||
try {
|
||||
try {
|
||||
throw new Exception("ex");
|
||||
} catch (Exception $ref) {
|
||||
echo "Unreachable\n";
|
||||
}
|
||||
} catch (TypeError $e) {
|
||||
var_dump($test->i);
|
||||
echo $e . "\n\n";
|
||||
}
|
||||
|
||||
$ref =& $test->s;
|
||||
try {
|
||||
try {
|
||||
throw new Exception("ex");
|
||||
} catch (Exception $ref) {
|
||||
echo "Unreachable\n";
|
||||
}
|
||||
} catch (TypeError $e) {
|
||||
var_dump($test->s);
|
||||
echo $e . "\n\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
int(42)
|
||||
TypeError: Cannot assign Exception to reference held by property Test::$i of type int in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
|
||||
string(3) "str"
|
||||
TypeError: Cannot assign Exception to reference held by property Test::$s of type string in %s:%d
|
||||
Stack trace:
|
||||
#0 {main}
|
||||
@@ -1,12 +0,0 @@
|
||||
--TEST--
|
||||
Internal class as parent
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
class Test extends DateTime {
|
||||
public static function createFromFormat($format, $time, Wrong $timezone = null) { }
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: Could not check compatibility between Test::createFromFormat($format, $time, ?Wrong $timezone = NULL) and DateTime::createFromFormat($format, $time, ?DateTimeZone $object = NULL), because class Wrong is not available in %s on line %d
|
||||
@@ -1,27 +0,0 @@
|
||||
--TEST--
|
||||
Use of parent inside a class that has / has no parent (success cases)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// Legal: A2::parent == P2
|
||||
class P2 {}
|
||||
class A2 extends P2 {
|
||||
public function method(parent $x) {}
|
||||
}
|
||||
class B2 extends A2 {
|
||||
public function method(P2 $x) {}
|
||||
}
|
||||
|
||||
// Legal: B3::parent == A3 is subclass of A3::parent == P3 in covariant position
|
||||
class P3 {}
|
||||
class A3 extends P3 {
|
||||
public function method($x): parent {}
|
||||
}
|
||||
class B3 extends A3 {
|
||||
public function method($x): parent {}
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
===DONE===
|
||||
Loaded 100 of 1713 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user