mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fixes to GH-14078: * Rename ZipArchive::openBuffer() to ::openString(). * For consistency with ::open(), return int|bool, don't throw an exception on error. Provide error information via existing properties and accessors. * Fix memory leak when ::openString() is called but ::close() is not called. Add test. * Fix memory leak when a call to ::open() is followed by a call to ::openString(). Add test. * Let libzip own the source, don't call zip_source_keep(). * Share buffer handling with ZipArchive::addFromString(). Elsewhere: * If there is an error from zip_close() during a call to ZipArchive::open(), emit a warning but proceed to open the archive, don't return early. Add test. * When buffers are saved by ZipArchive::addFromString(), release them in ZipArchive::close() and ::open(), don't accumulate buffers until the free_obj handler is called. * Factor out buffer handling and reuse it in ZipArchive::openString() Closes GH-21205. Closes GH-14078. Co-authored-by: Soner Sayakci <s.sayakci@shopware.com> Co-authored-by: Ghaith Olabi <24876890+Gaitholabi@users.noreply.github.com>
266 lines
8.8 KiB
Plaintext
266 lines
8.8 KiB
Plaintext
PHP 8.6 UPGRADE NOTES
|
|
|
|
1. Backward Incompatible Changes
|
|
2. New Features
|
|
3. Changes in SAPI modules
|
|
4. Deprecated Functionality
|
|
5. Changed Functions
|
|
6. New Functions
|
|
7. New Classes and Interfaces
|
|
8. Removed Extensions and SAPIs
|
|
9. Other Changes to Extensions
|
|
10. New Global Constants
|
|
11. Changes to INI File Handling
|
|
12. Windows Support
|
|
13. Other Changes
|
|
14. Performance Improvements
|
|
|
|
========================================
|
|
1. Backward Incompatible Changes
|
|
========================================
|
|
|
|
- PCRE:
|
|
. preg_grep() now returns false instead of a partial array when a PCRE
|
|
execution error occurs (e.g. malformed UTF-8 input with the /u modifier).
|
|
This is consistent with other preg_* functions.
|
|
|
|
- Phar:
|
|
. Invalid values now throw in Phar::mungServer() instead of being silently
|
|
ignored.
|
|
|
|
- Session:
|
|
. A ValueError is not thrown if $name is a string containing null bytes in
|
|
session_module_name().
|
|
. session_encode() now returns an empty string instead of false for empty
|
|
sessions. It only returns false now when the session data could not be
|
|
encoded. This mainly happens with the default serialization handler
|
|
if a key contains the pipe | character.
|
|
. When session.lazy_write is enabled and a session handler implements
|
|
SessionUpdateTimestampHandlerInterface, sessions that were read as empty
|
|
and remain empty at write time will now trigger updateTimestamp() instead
|
|
of write(). Previously, write() was always called for empty sessions
|
|
because session_encode() returned false, bypassing the lazy_write
|
|
comparison. Custom session handlers that rely on write() being called
|
|
with empty data (e.g. to destroy the session) should implement the same
|
|
logic in their updateTimestamp() method.
|
|
|
|
- Standard:
|
|
. Invalid mode values now throw in array_filter() instead of being silently
|
|
defaulted to 0.
|
|
. Form feed (\f) is now added in the default trimmed characters of trim(),
|
|
rtrim() and ltrim(). RFC: https://wiki.php.net/rfc/trim_form_feed
|
|
|
|
========================================
|
|
2. New Features
|
|
========================================
|
|
|
|
- Core:
|
|
. It is now possible to use reference assign on WeakMap without the key
|
|
needing to be present beforehand.
|
|
|
|
- Fileinfo:
|
|
. finfo_file() now works with remote streams.
|
|
|
|
- Intl:
|
|
. Added IntlNumberRangeFormatter class to format an interval of two numbers
|
|
with a given skeleton, locale, IntlNumberRangeFormatter::COLLAPSE_AUTO,
|
|
IntlNumberRangeFormatter::COLLAPSE_NONE,
|
|
IntlNumberRangeFormatter::COLLAPSE_UNIT,
|
|
IntlNumberRangeFormatter::COLLAPSE_ALL collapse and
|
|
IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE,
|
|
IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE,
|
|
IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY and
|
|
IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE identity fallbacks.
|
|
It is supported from icu 63.
|
|
|
|
- JSON:
|
|
. Added extra info about error location to the JSON error messages returned
|
|
from json_last_error_msg() and JsonException message.
|
|
|
|
- Phar:
|
|
. Overriding the getMTime() and getPathname() methods of SplFileInfo now
|
|
influences the result of the phar buildFrom family of functions.
|
|
This makes it possible to override the timestamp and names of files.
|
|
|
|
- Streams:
|
|
. Added stream socket context option so_reuseaddr that allows disabling
|
|
address reuse (SO_REUSEADDR) and explicitly uses SO_EXCLUSIVEADDRUSE on
|
|
Windows.
|
|
. Added stream socket context options so_keepalive, tcp_keepidle,
|
|
tcp_keepintvl and tcp_keepcnt that allow setting socket keepalive
|
|
options.
|
|
. Allowed casting casting filtered streams as file descriptor for select.
|
|
|
|
========================================
|
|
3. Changes in SAPI modules
|
|
========================================
|
|
|
|
========================================
|
|
4. Deprecated Functionality
|
|
========================================
|
|
|
|
========================================
|
|
5. Changed Functions
|
|
========================================
|
|
|
|
- mysqli:
|
|
. The return structure of mysqli_get_charset() no longer contains
|
|
the undocumented "comment" element. The value of "charsetnr" is
|
|
now set to a constant 0 as this number was an implementation detail
|
|
that should not have been exposed to the public.
|
|
|
|
- OpenSSL:
|
|
. Output of openssl_x509_parse() contains criticalExtensions listing all
|
|
critical certificate extensions.
|
|
|
|
- PCNTL:
|
|
. pcntl_alarm() now throws a ValueError if the seconds argument is
|
|
lower than zero or greater than platform's UINT_MAX.
|
|
|
|
- Phar:
|
|
. Phar::mungServer() now supports reference values.
|
|
|
|
- Posix:
|
|
. posix_access() now throws a ValueError exception if the flags
|
|
argument is invalid.
|
|
. posix_mkfifo() now throws a ValueError exception if the permissions
|
|
argument is invalid.
|
|
|
|
- Sockets:
|
|
. socket_addrinfo_lookup() now has an additional optional argument $error
|
|
when not null, and on failure, gives the error code (one of the EAI_*
|
|
constants).
|
|
|
|
- Zip:
|
|
. ZipArchive::extractTo now raises a TypeError for the
|
|
files argument if one or more of the entries is not
|
|
a string.
|
|
|
|
========================================
|
|
6. New Functions
|
|
========================================
|
|
|
|
- Reflection:
|
|
. ReflectionConstant::inNamespace()
|
|
. Added ReflectionProperty::isReadable() and ReflectionProperty::isWritable().
|
|
RFC: https://wiki.php.net/rfc/isreadable-iswriteable
|
|
|
|
- Intl:
|
|
. `grapheme_strrev()` returns strrev for grapheme cluster unit.
|
|
RFC: https://wiki.php.net/rfc/grapheme_strrev
|
|
|
|
- Standard:
|
|
. `clamp()` returns the given value if in range, else return the nearest
|
|
bound.
|
|
RFC: https://wiki.php.net/rfc/clamp_v2
|
|
|
|
- Zip:
|
|
. Added ZipArchive::openString() method.
|
|
|
|
========================================
|
|
7. New Classes and Interfaces
|
|
========================================
|
|
|
|
========================================
|
|
8. Removed Extensions and SAPIs
|
|
========================================
|
|
|
|
========================================
|
|
9. Other Changes to Extensions
|
|
========================================
|
|
|
|
- Hash:
|
|
. The bundled version of xxHash was upgraded to 0.8.2.
|
|
|
|
- mysqli
|
|
. Added new constant MYSQLI_OPT_COMPRESS.
|
|
|
|
========================================
|
|
10. New Global Constants
|
|
========================================
|
|
|
|
- Sockets:
|
|
. TCP_USER_TIMEOUT (Linux only).
|
|
. AF_UNSPEC.
|
|
. EAI_BADFLAGS.
|
|
. EAI_NONAME.
|
|
. EAI_AGAIN.
|
|
. EAI_FAIL.
|
|
. EAI_NODATA.
|
|
. EAI_FAMILY.
|
|
. EAI_SOCKTYPE.
|
|
. EAI_SERVICE.
|
|
. EAI_ADDRFAMILY.
|
|
. EAI_SYSTEM.
|
|
. EAI_OVERFLOW
|
|
. EAI_INPROGRESS.
|
|
. EAI_CANCELED.
|
|
. EAI_NOTCANCELED.
|
|
. EAI_ALLDONE.
|
|
. EAI_INTR.
|
|
. EAI_IDN_ENCODE.
|
|
|
|
- Standard
|
|
. ARRAY_FILTER_USE_KEY.
|
|
|
|
========================================
|
|
11. Changes to INI File Handling
|
|
========================================
|
|
|
|
- Mysqli:
|
|
. mysqli.default_port now checks the validity of the value which should be
|
|
between 0 and 65535 included.
|
|
|
|
- Opcache:
|
|
. opcache.jit_debug accepts a new flag: ZEND_JIT_DEBUG_TRACE_EXIT_INFO_SRC.
|
|
When used along with ZEND_JIT_DEBUG_TRACE_EXIT_INFO, the source of exit
|
|
points is printed in exit info output, in debug builds.
|
|
|
|
- Mbstring:
|
|
. The mbstring.detect_order INI directive now updates the internal detection
|
|
order when changed at runtime via ini_set(). Previously, runtime changes
|
|
using ini_set() did not take effect for mb_detect_order(). Setting the
|
|
directive to NULL or an empty string at runtime now leaves the previously
|
|
configured detection order unchanged.
|
|
|
|
========================================
|
|
12. Windows Support
|
|
========================================
|
|
|
|
========================================
|
|
13. Other Changes
|
|
========================================
|
|
|
|
========================================
|
|
14. Performance Improvements
|
|
========================================
|
|
|
|
- Core:
|
|
. `printf()` using only `%s` and `%d` will be compiled into the equivalent
|
|
string interpolation, avoiding the overhead of a function call and
|
|
repeatedly parsing the format string.
|
|
. Arguments are now passed more efficiently to known constructors (e.g. when
|
|
using new self()).
|
|
. array_map() using a first-class callable or partial function application
|
|
callback will be compiled into the equivalent foreach-loop, avoiding the
|
|
creation of intermediate Closures, the overhead of calling userland
|
|
callbacks from internal functions and providing for better insight for the
|
|
JIT.
|
|
|
|
- DOM:
|
|
. Made splitText() faster and consume less memory.
|
|
|
|
- JSON:
|
|
. Improve performance of encoding arrays and objects.
|
|
|
|
- Standard:
|
|
. Improved performance of array_fill_keys().
|
|
. Improved performance of array_map() with multiple arrays passed.
|
|
. Improved performance of array_unshift().
|
|
. Improved performance of array_walk().
|
|
. Improved performance of intval('+0b...', 2) and intval('0b...', 2).
|
|
. Improved performance of str_split().
|
|
|
|
- Zip:
|
|
. Avoid string copies in ZipArchive::addFromString().
|