2018-07-31 21:54:03 +08:00
|
|
|
PHP 7.4 UPGRADE NOTES
|
2012-03-06 04:14:04 +08:00
|
|
|
|
|
|
|
1. Backward Incompatible Changes
|
|
|
|
2. New Features
|
2014-05-01 18:27:38 +08:00
|
|
|
3. Changes in SAPI modules
|
|
|
|
4. Deprecated Functionality
|
|
|
|
5. Changed Functions
|
|
|
|
6. New Functions
|
|
|
|
7. New Classes and Interfaces
|
2015-02-10 15:56:18 +08:00
|
|
|
8. Removed Extensions and SAPIs
|
2014-05-01 18:27:38 +08:00
|
|
|
9. Other Changes to Extensions
|
|
|
|
10. New Global Constants
|
|
|
|
11. Changes to INI File Handling
|
2014-08-22 19:35:07 +08:00
|
|
|
12. Windows Support
|
2019-01-15 17:19:45 +08:00
|
|
|
13. Migration to pkg-config
|
2019-01-15 17:13:39 +08:00
|
|
|
14. Other Changes
|
|
|
|
15. Performance Improvements
|
2010-03-25 00:23:50 +08:00
|
|
|
|
2005-11-23 07:49:13 +08:00
|
|
|
|
2010-03-25 00:23:50 +08:00
|
|
|
========================================
|
2012-03-06 04:14:04 +08:00
|
|
|
1. Backward Incompatible Changes
|
2010-03-25 00:23:50 +08:00
|
|
|
========================================
|
2016-04-25 05:49:52 +08:00
|
|
|
|
2019-01-04 18:55:41 +08:00
|
|
|
- Core:
|
2019-07-10 16:28:58 +08:00
|
|
|
. Trying to use values of type null, bool, int, float or resource as an
|
|
|
|
array (such as $null["key"]) will now generate a notice. This does not
|
|
|
|
affect array accesses performed by list().
|
2019-07-13 21:37:36 +08:00
|
|
|
RFC: https://wiki.php.net/rfc/notice-for-non-valid-array-container
|
2019-02-18 22:35:45 +08:00
|
|
|
. get_declared_classes() no longer returns anonymous classes that haven't
|
|
|
|
been instantiated yet.
|
2019-05-02 20:57:16 +08:00
|
|
|
. "fn" is now a reserved keyword. In particular it can no longer be used as a
|
|
|
|
function or class name. It can still be used as a method or class constant
|
|
|
|
name.
|
2019-05-09 20:19:53 +08:00
|
|
|
. Passing the result of a (non-reference) list() assignment by reference is
|
|
|
|
consistently disallowed now. Previously this worked if the right hand side
|
|
|
|
was a simple (CV) variable and did not occur as part of the list().
|
2019-07-15 23:26:26 +08:00
|
|
|
. `<?php` at the end of the file (without trailing newline) will now be
|
|
|
|
interpreted as an opening PHP tag. Previously it was interpreted either as
|
|
|
|
`<? php` and resulted in a syntax error (with short_open_tag=1) or was
|
|
|
|
interpreted as a literal `<?php` string (with short_open_tag=0).
|
2019-01-04 18:55:41 +08:00
|
|
|
|
2019-04-30 22:33:04 +08:00
|
|
|
- BCMath:
|
|
|
|
. BCMath functions will now warn if a non well-formed number is passed, such
|
|
|
|
as "32foo". The argument will be interpreted as zero (as before).
|
|
|
|
|
2018-11-26 20:20:51 +08:00
|
|
|
- Curl:
|
|
|
|
. Attempting to serialize a CURLFile class will now generate an exception.
|
|
|
|
Previously the exception was only thrown on unserialization.
|
2019-05-07 23:05:07 +08:00
|
|
|
. Using CURLPIPE_HTTP1 is deprecated, and is no longer supported as of cURL
|
|
|
|
7.62.0.
|
2019-05-13 14:53:41 +08:00
|
|
|
. The $version parameter of curl_version() is deprecated. If any value not
|
|
|
|
equal to the default CURLVERSION_NOW is passed, a warning is raised and the
|
|
|
|
parameter is ignored.
|
2018-11-26 20:20:51 +08:00
|
|
|
|
2018-10-10 18:00:57 +08:00
|
|
|
- Date:
|
|
|
|
. Calling var_dump() or similar on a DateTime(Immutable) instance will no
|
|
|
|
longer leave behind accessible properties on the object.
|
2019-04-18 19:46:10 +08:00
|
|
|
. Comparison of DateInterval objects (using ==, < and so on) will now generate
|
|
|
|
a warning and always return false. Previously all DateInterval objects were
|
|
|
|
considered equal, unless they had properties.
|
2018-10-10 18:00:57 +08:00
|
|
|
|
2018-09-15 20:37:55 +08:00
|
|
|
- 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.
|
|
|
|
|
2019-02-28 19:51:19 +08:00
|
|
|
- MySQLi:
|
|
|
|
. The embedded server functionality has been removed. It was broken since
|
|
|
|
at least PHP 7.0.
|
2019-06-26 04:32:54 +08:00
|
|
|
. The undocumented mysqli::$stat property has been removed in favor of
|
|
|
|
mysqli::stat().
|
2019-02-28 19:51:19 +08:00
|
|
|
|
2018-11-20 07:14:53 +08:00
|
|
|
- Openssl:
|
|
|
|
. The openssl_random_pseudo_bytes() function will now throw an exception in
|
|
|
|
error situations, similar to random_bytes(). In particular, an Error is
|
2019-07-26 01:23:26 +08:00
|
|
|
thrown if the number of requested bytes is less than *or equal to* zero,
|
|
|
|
and an Exception is thrown if sufficient randomness cannot be gathered.
|
2018-11-20 07:14:53 +08:00
|
|
|
The $crypto_strong output argument is guaranteed to always be true if the
|
|
|
|
function does not throw, so explicitly checking it is not necessary.
|
|
|
|
RFC: http://php.net/manual/de/function.openssl-random-pseudo-bytes.php
|
|
|
|
|
2019-03-19 19:11:05 +08:00
|
|
|
- PCRE:
|
|
|
|
. When PREG_UNMATCHED_AS_NULL mode is used, trailing unmatched capturing
|
|
|
|
groups will now also be set to null (or [null, -1] if offset capture is
|
|
|
|
enabled). This means that the size of the $matches will always be the same.
|
|
|
|
|
2019-02-01 19:09:29 +08:00
|
|
|
- PEAR:
|
|
|
|
. Installation of PEAR (including PECL) is no longer enabled by default. It
|
|
|
|
can be explicitly enabled using --with-pear. This option is deprecated and
|
|
|
|
may be removed in the future.
|
|
|
|
|
2018-11-26 20:28:14 +08:00
|
|
|
- PDO:
|
2018-11-26 20:30:57 +08:00
|
|
|
. Attempting to serialize a PDO or PDOStatement instance will now generate
|
|
|
|
an Exception rather than a PDOException, consistent with other internal
|
|
|
|
classes which do not support serialization.
|
2018-11-26 20:28:14 +08:00
|
|
|
|
2018-09-29 20:47:57 +08:00
|
|
|
- Reflection:
|
|
|
|
. Reflection objects will now generate an exception if an attempt is made
|
|
|
|
to serialize them. Serialization for reflection objects was never
|
|
|
|
supported and resulted in corrupted reflection objects. It has been
|
|
|
|
explicitly prohibited now.
|
|
|
|
|
2018-10-10 18:00:57 +08:00
|
|
|
- SPL:
|
|
|
|
. Calling get_object_vars() on an ArrayObject instance will now always return
|
|
|
|
the properties of the ArrayObject itself (or a subclass). Previously it
|
|
|
|
returned the values of the wrapped array/object unless the STD_PROP_LIST
|
|
|
|
flag was specified. Other affected operations are:
|
|
|
|
|
|
|
|
* ReflectionObject::getProperties()
|
|
|
|
* reset(), current(), etc. Use Iterator methods instead.
|
|
|
|
* Potentially others working on object properties as a list.
|
|
|
|
|
|
|
|
(array) casts are *not* affected. They will continue to return either the
|
|
|
|
wrapped array, or the ArrayObject properties, depending on whether the
|
|
|
|
STD_PROP_LIST flag is used.
|
2018-11-16 04:05:05 +08:00
|
|
|
. SplPriorityQueue::setExtractFlags() will throw an exception if zero is
|
|
|
|
passed. Previously this would generate a recoverable fatal error on the
|
|
|
|
next extraction operation.
|
2019-04-09 20:57:06 +08:00
|
|
|
. ArrayObject, ArrayIterator, SplDoublyLinkedList and SplObjectStorage now
|
|
|
|
support the __serialize() + __unserialize() mechanism in addition to the
|
|
|
|
Serializable interface. This means that serialization payloads created on
|
|
|
|
older PHP versions can still be unserialized, but new payloads created by
|
|
|
|
PHP 7.4 will not be understood by older versions.
|
2018-10-10 18:00:57 +08:00
|
|
|
|
2019-01-23 01:07:46 +08:00
|
|
|
- Standard:
|
|
|
|
. The "o" serialization format has been removed. As it is never produced by
|
|
|
|
PHP, this may only break unserialization of manually crafted strings.
|
2019-05-07 08:22:29 +08:00
|
|
|
. Password hashing algorithm identifiers are now nullable strings rather
|
|
|
|
than integers.
|
|
|
|
|
|
|
|
* 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'
|
|
|
|
|
|
|
|
Applications correctly using the constants PASSWORD_DEFAULT,
|
|
|
|
PASSWORD_BCRYPT, PASSWORD_ARGON2I, and PASSWORD_ARGON2ID will continue to
|
|
|
|
function correctly.
|
2019-07-15 03:47:01 +08:00
|
|
|
. htmlentities() will now throw a notice (instead of a strict standards
|
|
|
|
warning) if it is used with an encoding for which only basic entity
|
|
|
|
substitution is supported, in which case it is equivalent to
|
|
|
|
htmlspecialchars().
|
2019-07-22 23:56:16 +08:00
|
|
|
. fread() and fwrite() will now return false if the operation failed.
|
|
|
|
Previously an empty string or 0 was returned. EAGAIN/EWOULDBLOCK are not
|
|
|
|
considered failures.
|
2019-07-23 17:57:02 +08:00
|
|
|
. fread() and fwrite() on plain files will now throw a notice on failure,
|
|
|
|
such as when trying to write to a read-only file resource.
|
2019-01-23 01:07:46 +08:00
|
|
|
|
2019-07-15 18:51:01 +08:00
|
|
|
- Tokenizer:
|
|
|
|
. token_get_all() will now emit a T_BAD_CHARACTER token for unexpected
|
|
|
|
characters instead of leaving behind holes in the token stream.
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
|
|
|
2. New Features
|
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2019-01-07 19:28:51 +08:00
|
|
|
- Core:
|
|
|
|
. Added support for typed properties. For example:
|
|
|
|
|
|
|
|
class User {
|
|
|
|
public int $id;
|
|
|
|
public string $name;
|
|
|
|
}
|
|
|
|
|
2019-07-26 01:23:26 +08:00
|
|
|
This will enforce that $user->id can only be assigned integers and
|
2019-01-07 19:28:51 +08:00
|
|
|
$user->name can only be assigned strings. For more information see the
|
|
|
|
RFC: https://wiki.php.net/rfc/typed_properties_v2
|
2019-01-23 00:47:16 +08:00
|
|
|
|
2019-05-02 20:57:16 +08:00
|
|
|
. Added support for arrow functions with implicit by-value scope binding.
|
|
|
|
For example:
|
|
|
|
|
|
|
|
$factor = 10;
|
|
|
|
$nums = array_map(fn($num) => $num * $factor, $nums);
|
|
|
|
|
|
|
|
RFC: https://wiki.php.net/rfc/arrow_functions_v2
|
|
|
|
|
2019-05-24 16:58:33 +08:00
|
|
|
. Added support for limited return type covariance and argument type
|
|
|
|
contravariance. The following code will now work:
|
|
|
|
|
|
|
|
class A {}
|
|
|
|
class B extends A {}
|
|
|
|
|
|
|
|
class Producer {
|
|
|
|
public function method(): A {}
|
|
|
|
}
|
|
|
|
class ChildProducer extends Producer {
|
|
|
|
public function method(): B {}
|
|
|
|
}
|
|
|
|
|
2019-05-27 17:39:56 +08:00
|
|
|
Full variance support is only available if autoloading is used. Inside a
|
|
|
|
single file only non-cyclic type references are possible, because all
|
|
|
|
classes need to be available before they are referenced.
|
2019-05-24 16:58:33 +08:00
|
|
|
RFC: https://wiki.php.net/rfc/covariant-returns-and-contravariant-parameters
|
|
|
|
|
2019-01-16 00:04:24 +08:00
|
|
|
. Added support for coalesce assign (??=) operator. For example:
|
|
|
|
|
|
|
|
$array['key'] ??= computeDefault();
|
|
|
|
// is roughly equivalent to
|
|
|
|
if (!isset($array['key'])) {
|
|
|
|
$array['key'] = computeDefault();
|
|
|
|
}
|
|
|
|
|
|
|
|
RFC: https://wiki.php.net/rfc/null_coalesce_equal_operator
|
2019-01-07 19:28:51 +08:00
|
|
|
|
2018-10-06 22:04:41 +08:00
|
|
|
. Added support for unpacking inside arrays. For example:
|
|
|
|
|
|
|
|
$arr1 = [3, 4];
|
|
|
|
$arr2 = [1, 2, ...$arr1, 5];
|
|
|
|
// $arr2 == [1, 2, 3, 4, 5]
|
|
|
|
|
|
|
|
RFC: https://wiki.php.net/rfc/spread_operator_for_array
|
|
|
|
|
2019-05-03 01:10:19 +08:00
|
|
|
. Added support for underscore separators in numeric literals. Some examples:
|
|
|
|
|
|
|
|
6.674_083e-11; // float
|
|
|
|
299_792_458; // decimal
|
|
|
|
0xCAFE_F00D; // hexadecimal
|
|
|
|
0b0101_1111; // binary
|
|
|
|
|
|
|
|
RFC: https://wiki.php.net/rfc/numeric_literal_separator
|
|
|
|
|
2019-03-12 13:52:43 +08:00
|
|
|
. Support for WeakReferences has been added.
|
|
|
|
RFC: https://wiki.php.net/rfc/weakrefs
|
|
|
|
|
2019-02-26 22:32:18 +08:00
|
|
|
. Throwing exceptions from __toString() is now permitted. Previously this
|
|
|
|
resulted in a fatal error. Existing recoverable fatals in string conversions
|
|
|
|
have been converted to Error exceptions.
|
|
|
|
RFC: https://wiki.php.net/rfc/tostring_exceptions
|
|
|
|
|
2019-04-29 16:21:07 +08:00
|
|
|
- CURL:
|
|
|
|
. CURLFile now supports stream wrappers in addition to plain file names, if
|
|
|
|
the extension has been built against libcurl >= 7.56.0. The streams may
|
|
|
|
need to be seekable.
|
|
|
|
|
2019-03-30 03:18:19 +08:00
|
|
|
- Filter:
|
|
|
|
. The FILTER_VALIDATE_FLOAT filter now supports the min_range and max_range
|
|
|
|
options, with the same semantics as FILTER_VALIDATE_INT.
|
|
|
|
|
2019-01-21 22:58:02 +08:00
|
|
|
- FFI:
|
|
|
|
. A new extension which provides a simple way to call native functions, access
|
|
|
|
native variables and create/access data structures defined in C libraries.
|
|
|
|
RFC: https://wiki.php.net/rfc/ffi
|
|
|
|
|
2019-05-10 07:37:02 +08:00
|
|
|
- GD:
|
|
|
|
. Added the "scatter" image filter (IMG_FILTER_SCATTER) to apply a scatter
|
|
|
|
filter to images. This filter has the following prototype:
|
|
|
|
|
|
|
|
imagefilter($im, IMG_FILTER_SCATTER, int $sub, int $plus, array $colors = []);
|
|
|
|
|
2019-07-26 01:23:26 +08:00
|
|
|
The $colors array can be populated with a set of indexed colors to
|
2019-05-10 07:37:02 +08:00
|
|
|
apply the scatter pixel shifting on.
|
|
|
|
|
|
|
|
Note, the result of this filter is always random.
|
|
|
|
|
2019-03-04 11:57:40 +08:00
|
|
|
- Hash:
|
|
|
|
. Added "crc32c" hash using Castagnoli's polynomial. This crc32 variant is
|
|
|
|
used by storage systems, such as iSCSI, SCTP, Btrfs and ext4.
|
|
|
|
|
2019-02-10 03:27:48 +08:00
|
|
|
- Mbstring:
|
2019-07-26 01:23:26 +08:00
|
|
|
. Added mb_str_split() function, which provides the same functionality as
|
2019-02-10 03:27:48 +08:00
|
|
|
str_split(), but operating on code points rather than bytes.
|
|
|
|
RFC: https://wiki.php.net/rfc/mb_str_split
|
|
|
|
|
2019-01-21 22:58:02 +08:00
|
|
|
- OPcache:
|
|
|
|
. Support for preloading code has been added.
|
|
|
|
RFC: https://wiki.php.net/rfc/preload
|
|
|
|
|
2019-03-18 21:22:06 +08:00
|
|
|
- PCRE:
|
|
|
|
. The preg_replace_callback() and preg_replace_callback_array() functions now
|
|
|
|
accept an additional $flags argument, with support for the
|
|
|
|
PREG_OFFSET_CAPTURE and PREG_UNMATCHED_AS_NULL flags. This influences the
|
|
|
|
format of the matches array passed to to the callback function.
|
|
|
|
|
2017-08-14 17:41:47 +08:00
|
|
|
- PDO:
|
|
|
|
. The username and password can now be specified as part of the PDO DSN for
|
|
|
|
the mysql, mssql, sybase, dblib, firebird and oci drivers. Previously this
|
|
|
|
was only supported by the pgsql driver. If a username/password is specified
|
|
|
|
both in the constructor and the DSN, the constructor takes precedence.
|
|
|
|
|
|
|
|
new PDO("mysql:host=xxx;port=xxx;dbname=xxx;user=xxx;password=xxx");
|
|
|
|
|
2018-10-01 13:24:04 +08:00
|
|
|
- PDO_OCI:
|
2019-01-07 19:28:51 +08:00
|
|
|
. PDOStatement::getColumnMeta() is now available
|
2018-10-01 13:24:04 +08:00
|
|
|
|
2018-09-21 21:00:07 +08:00
|
|
|
- PDO_SQLite:
|
2019-07-26 01:23:26 +08:00
|
|
|
. PDOStatement::getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT) allows
|
|
|
|
checking whether the statement is read-only, i.e. if it doesn't modify
|
2018-09-21 21:00:07 +08:00
|
|
|
the database.
|
2019-07-02 18:59:01 +08:00
|
|
|
. PDO::setAttribute(PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES, true) enables the
|
|
|
|
use of SQLite3 extended result codes in errorInfo().
|
|
|
|
|
2019-07-08 22:23:27 +08:00
|
|
|
- SQLite3:
|
2019-07-02 18:59:01 +08:00
|
|
|
. Added SQLite3::lastExtendedErrorCode() to fetch the last extended result
|
|
|
|
code.
|
|
|
|
. Added SQLite3::enableExtendedResultCodes($enable = true), which will make
|
|
|
|
SQLite3::lastErrorCode() return extended result codes.
|
2018-09-21 21:00:07 +08:00
|
|
|
|
2018-12-30 05:10:19 +08:00
|
|
|
- Standard:
|
|
|
|
. strip_tags() now also accepts an array of allowed tags: Instead of
|
|
|
|
strip_tags($str, '<a><p>') you can now write strip_tags($str, ['a', 'p']).
|
|
|
|
|
2019-01-23 00:47:16 +08:00
|
|
|
. A new mechanism for custom object serialization has been added, which
|
|
|
|
uses two new magic methods:
|
|
|
|
|
|
|
|
// Returns array containing all the necessary state of the object.
|
|
|
|
public function __serialize(): array;
|
|
|
|
|
|
|
|
// Restores the object state from the given data array.
|
|
|
|
public function __unserialize(array $data): void;
|
|
|
|
|
|
|
|
The new serialization mechanism supersedes the Serializable interface,
|
|
|
|
which will be deprecated in the future.
|
|
|
|
|
|
|
|
RFC: https://wiki.php.net/rfc/custom_object_serialization
|
|
|
|
|
2019-05-17 04:08:08 +08:00
|
|
|
. array_merge() and array_merge_recursive() may now be called without any
|
|
|
|
arguments, in which case they will return an empty array. This is useful
|
|
|
|
in conjunction with the spread operator, e.g. array_merge(...$arrays).
|
|
|
|
|
2019-06-24 18:53:40 +08:00
|
|
|
. proc_open() now accepts an array instead of a string for the command. In
|
|
|
|
this case the process will be opened directly (without going through a
|
|
|
|
shell) and PHP will take care of any necessary argument escaping.
|
|
|
|
|
|
|
|
proc_open(['php', '-r', 'echo "Hello World\n";'], $descriptors, $pipes);
|
|
|
|
|
2019-07-05 23:41:59 +08:00
|
|
|
. proc_open() now supports "redirect" and "null" descriptors. For example:
|
|
|
|
|
|
|
|
// Like 2>&1 on the shell
|
|
|
|
proc_open($cmd, [1 => ['pipe', 'w'], 2 => ['redirect', 1]], $pipes);
|
|
|
|
// Like 2>/dev/null or 2>nul on the shell
|
|
|
|
proc_open($cmd, [1 => ['pipe', 'w'], 2 => ['null']], $pipes);
|
|
|
|
|
2019-07-08 22:23:27 +08:00
|
|
|
. password_hash() has argon2i(d) implementations from ext/sodium when PHP is
|
|
|
|
built without libargon.
|
|
|
|
|
|
|
|
RFC: https://wiki.php.net/rfc/sodium.argon.hash
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
3. Changes in SAPI modules
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
4. Deprecated Functionality
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2018-09-30 02:58:17 +08:00
|
|
|
- Core:
|
2019-05-24 16:58:33 +08:00
|
|
|
. Nesting ternary operators without explicit parentheses is deprecated:
|
|
|
|
|
|
|
|
// Code like
|
|
|
|
$a ? $b : $c ? $d : $e
|
|
|
|
// should be replaced by (current interpretation)
|
|
|
|
($a ? $b : $c) ? $d : $e
|
|
|
|
// or (likely intended interpretation)
|
|
|
|
$a ? $b : ($c ? $d : $e)
|
|
|
|
|
|
|
|
RFC: https://wiki.php.net/rfc/ternary_associativity
|
2019-03-13 18:51:31 +08:00
|
|
|
. The array and string offset access syntax using curly braces is deprecated.
|
|
|
|
Use $str[$idx] instead of $str{$idx}.
|
|
|
|
RFC: https://wiki.php.net/rfc/deprecate_curly_braces_array_access
|
2019-07-22 17:53:50 +08:00
|
|
|
. The (real) cast is deprecated, use (float) instead.
|
2018-09-30 02:58:17 +08:00
|
|
|
. Unbinding $this of a non-static method through a combination of
|
|
|
|
ReflectionMethod::getClosure() and closure rebinding is deprecated. Doing
|
|
|
|
so is equivalent to calling a non-static method statically, which has been
|
|
|
|
deprecated since PHP 7.0.
|
2019-07-22 17:53:50 +08:00
|
|
|
. Unbinding $this of a non-static closure is deprecated.
|
2019-07-26 01:23:26 +08:00
|
|
|
. Using "parent" inside a class without a parent is deprecated, and will throw
|
2019-05-24 16:58:33 +08:00
|
|
|
a compile-time error in the future. Currently an error will only be
|
|
|
|
generated if/when the parent is accessed at run-time.
|
2019-07-22 17:53:50 +08:00
|
|
|
. The allow_url_include ini directive is deprecated. Enabling it will generate
|
|
|
|
a deprecation notice at startup.
|
2018-09-30 02:58:17 +08:00
|
|
|
|
2019-02-15 01:34:47 +08:00
|
|
|
- COM:
|
|
|
|
. Importing type libraries with case-insensitive constant registering has been
|
|
|
|
deprecated.
|
|
|
|
|
2019-07-22 17:53:50 +08:00
|
|
|
- Filter:
|
2019-07-26 01:23:26 +08:00
|
|
|
. FILTER_SANITIZE_MAGIC_QUOTES is deprecated, use FILTER_SANITIZE_ADD_SLASHES
|
2019-07-22 17:53:50 +08:00
|
|
|
instead.
|
|
|
|
|
2019-02-01 21:58:10 +08:00
|
|
|
- Mbstring:
|
|
|
|
. Passing a non-string pattern to mb_ereg_replace() is deprecated. Currently
|
|
|
|
non-string patterns are interpreted as ASCII codepoints. In PHP 8 the
|
|
|
|
pattern will be interpreted as a string instead.
|
2019-07-22 17:53:50 +08:00
|
|
|
. Passing the encoding as 3rd parameter to mb_strrpos() is deprecated. Instead
|
|
|
|
pass a 0 offset and encoding as 4th parameter.
|
2019-02-01 21:58:10 +08:00
|
|
|
|
2019-02-04 19:09:51 +08:00
|
|
|
- LDAP:
|
2019-02-01 19:09:29 +08:00
|
|
|
. ldap_control_paged_result_response and ldap_control_paged_result are
|
|
|
|
deprecated. Pagination controls can be sent along with ldap_search instead.
|
2019-02-04 19:09:51 +08:00
|
|
|
|
2019-06-05 21:33:52 +08:00
|
|
|
- Reflection:
|
|
|
|
. Calls to ReflectionType::__toString() now generate a deprecation notice.
|
|
|
|
This method has been deprecated in favor of ReflectionNamedType::getName()
|
|
|
|
in the documentation since PHP 7.1, but did not throw a deprecation notice
|
|
|
|
for technical reasons.
|
2019-07-22 17:53:50 +08:00
|
|
|
. The export() methods on all Reflection classes are deprecated. Construct a
|
|
|
|
Reflection object and convert it to string instead:
|
|
|
|
|
|
|
|
// ReflectionClass::export(Foo::class, false) is:
|
|
|
|
echo new ReflectionClass(Foo::class), "\n";
|
|
|
|
// $str = ReflectionClass::export(Foo::class, true) is:
|
|
|
|
$str = (string) new ReflectionClass(Foo::class);
|
2019-06-05 21:33:52 +08:00
|
|
|
|
2019-06-28 14:12:39 +08:00
|
|
|
- Standard:
|
|
|
|
. Passing invalid characters to ''base_convert()'', ''bindec()'', ''octdec()''
|
|
|
|
and ''hexdec()'' will now generate a deprecation notice. The result will
|
|
|
|
still be computed as if the invalid characters did not exist. Leading and
|
|
|
|
trailing whitespace, as well as prefixes of type 0x (depending on base)
|
|
|
|
continue to be allowed.
|
2019-07-22 17:53:50 +08:00
|
|
|
. Using array_key_exists() on objects is deprecated. Instead either isset()
|
|
|
|
or property_exists() should be used.
|
|
|
|
. The is_real() function is deprecated, use is_float() instead.
|
|
|
|
. The get_magic_quotes_gpc() and get_magic_quotes_runtime() functions are
|
|
|
|
deprecated. They always return false.
|
|
|
|
. The hebrevc() function is deprecated. It can be replaced with
|
|
|
|
nl2br(hebrev($str)), or preferably the use of Unicode RTL support.
|
|
|
|
. The convert_cyr_string() function is deprecated. It can be replaced by one
|
|
|
|
of mb_convert_string(), iconv() or UConverter.
|
|
|
|
. The money_format() function is deprecated. It can be replaced by the
|
|
|
|
intl NumberFormatter functionality.
|
|
|
|
. The ezmlm_hash() function is deprecated.
|
2019-07-26 01:23:26 +08:00
|
|
|
. The restore_include_path() function is deprecated. It can be replaced by
|
2019-07-22 17:53:50 +08:00
|
|
|
ini_restore('include_path').
|
|
|
|
. Passing parameters to implode() in reverse order is deprecated, use
|
|
|
|
implode($glue, $parts) instead of implode($parts, $glue).
|
2019-06-28 14:12:39 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
5. Changed Functions
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2009-06-24 03:40:31 +08:00
|
|
|
|
Allow empty $escape to eschew escaping CSV
Albeit CSV is still a widespread data exchange format, it has never been
officially standardized. There exists, however, the “informational” RFC
4180[1] which has no notion of escape characters, but rather defines
`escaped` as strings enclosed in double-quotes where contained
double-quotes have to be doubled. While this concept is supported by
PHP's implementation (`$enclosure`), the `$escape` sometimes interferes,
so that `fgetcsv()` is unable to correctly parse externally generated
CSV, and `fputcsv()` is sometimes generating non-compliant CSV. Since
PHP's `$escape` concept is availble for many years, we cannot drop it
for BC reasons (even though many consider it as bug). Instead we allow
to pass an empty string as `$escape` parameter to the respective
functions, which results in ignoring/omitting any escaping, and as such
is more inline with RFC 4180. It is noteworthy that this is almost no
userland BC break, since formerly most functions did not accept an empty
string, and failed in this case. The only exception was `str_getcsv()`
which did accept an empty string, and used a backslash as escape
character then (which appears to be unintended behavior, anyway).
The changed functions are `fputcsv()`, `fgetcsv()` and `str_getcsv()`,
and also the `::setCsvControl()`, `::getCsvControl()`, `::fputcsv()`,
and `::fgetcsv()` methods of `SplFileObject`.
The implementation also changes the type of the escape parameter of the
PHP_APIs `php_fgetcsv()` and `php_fputcsv()` from `char` to `int`, where
`PHP_CSV_NO_ESCAPE` means to ignore/omit escaping. The parameter
accepts the same values as `isalpha()` and friends, i.e. “the value of
which shall be representable as an `unsigned char` or shall equal the
value of the macro `EOF`. If the argument has any other value, the
behavior is undefined.” This is a subtle BC break, since the character
`chr(128)` has the value `-1` if `char` is signed, and so likely would
be confused with `EOF` when converted to `int`. We consider this BC
break to be acceptable, since it's rather unlikely that anybody uses
`chr(128)` as escape character, and it easily can be fixed by casting
all `escape` arguments to `unsigned char`.
This patch implements the feature requests 38301[2] and 51496[3].
[1] <https://tools.ietf.org/html/rfc4180>
[2] <https://bugs.php.net/bug.php?id=38301>
[3] <https://bugs.php.net/bug.php?id=51496>
2018-12-02 23:28:18 +08:00
|
|
|
- SPL:
|
|
|
|
. SplFileObject::fputcsv(), ::fgetcsv() and ::setCsvControl() now accept an
|
2019-05-12 23:19:54 +08:00
|
|
|
empty string as $escape argument, which disables the proprietary PHP
|
Allow empty $escape to eschew escaping CSV
Albeit CSV is still a widespread data exchange format, it has never been
officially standardized. There exists, however, the “informational” RFC
4180[1] which has no notion of escape characters, but rather defines
`escaped` as strings enclosed in double-quotes where contained
double-quotes have to be doubled. While this concept is supported by
PHP's implementation (`$enclosure`), the `$escape` sometimes interferes,
so that `fgetcsv()` is unable to correctly parse externally generated
CSV, and `fputcsv()` is sometimes generating non-compliant CSV. Since
PHP's `$escape` concept is availble for many years, we cannot drop it
for BC reasons (even though many consider it as bug). Instead we allow
to pass an empty string as `$escape` parameter to the respective
functions, which results in ignoring/omitting any escaping, and as such
is more inline with RFC 4180. It is noteworthy that this is almost no
userland BC break, since formerly most functions did not accept an empty
string, and failed in this case. The only exception was `str_getcsv()`
which did accept an empty string, and used a backslash as escape
character then (which appears to be unintended behavior, anyway).
The changed functions are `fputcsv()`, `fgetcsv()` and `str_getcsv()`,
and also the `::setCsvControl()`, `::getCsvControl()`, `::fputcsv()`,
and `::fgetcsv()` methods of `SplFileObject`.
The implementation also changes the type of the escape parameter of the
PHP_APIs `php_fgetcsv()` and `php_fputcsv()` from `char` to `int`, where
`PHP_CSV_NO_ESCAPE` means to ignore/omit escaping. The parameter
accepts the same values as `isalpha()` and friends, i.e. “the value of
which shall be representable as an `unsigned char` or shall equal the
value of the macro `EOF`. If the argument has any other value, the
behavior is undefined.” This is a subtle BC break, since the character
`chr(128)` has the value `-1` if `char` is signed, and so likely would
be confused with `EOF` when converted to `int`. We consider this BC
break to be acceptable, since it's rather unlikely that anybody uses
`chr(128)` as escape character, and it easily can be fixed by casting
all `escape` arguments to `unsigned char`.
This patch implements the feature requests 38301[2] and 51496[3].
[1] <https://tools.ietf.org/html/rfc4180>
[2] <https://bugs.php.net/bug.php?id=38301>
[3] <https://bugs.php.net/bug.php?id=51496>
2018-12-02 23:28:18 +08:00
|
|
|
escaping mechanism. SplFileObject::getCsvControl() now may also return an
|
|
|
|
empty string for the third array element, accordingly.
|
|
|
|
|
|
|
|
- Standard:
|
2019-01-20 00:02:37 +08:00
|
|
|
. fputcsv() and fgetcsv() now accept an empty string as $escape argument,
|
2019-05-12 23:19:54 +08:00
|
|
|
which disables the proprietary PHP escaping mechanism. The behavior of
|
Allow empty $escape to eschew escaping CSV
Albeit CSV is still a widespread data exchange format, it has never been
officially standardized. There exists, however, the “informational” RFC
4180[1] which has no notion of escape characters, but rather defines
`escaped` as strings enclosed in double-quotes where contained
double-quotes have to be doubled. While this concept is supported by
PHP's implementation (`$enclosure`), the `$escape` sometimes interferes,
so that `fgetcsv()` is unable to correctly parse externally generated
CSV, and `fputcsv()` is sometimes generating non-compliant CSV. Since
PHP's `$escape` concept is availble for many years, we cannot drop it
for BC reasons (even though many consider it as bug). Instead we allow
to pass an empty string as `$escape` parameter to the respective
functions, which results in ignoring/omitting any escaping, and as such
is more inline with RFC 4180. It is noteworthy that this is almost no
userland BC break, since formerly most functions did not accept an empty
string, and failed in this case. The only exception was `str_getcsv()`
which did accept an empty string, and used a backslash as escape
character then (which appears to be unintended behavior, anyway).
The changed functions are `fputcsv()`, `fgetcsv()` and `str_getcsv()`,
and also the `::setCsvControl()`, `::getCsvControl()`, `::fputcsv()`,
and `::fgetcsv()` methods of `SplFileObject`.
The implementation also changes the type of the escape parameter of the
PHP_APIs `php_fgetcsv()` and `php_fputcsv()` from `char` to `int`, where
`PHP_CSV_NO_ESCAPE` means to ignore/omit escaping. The parameter
accepts the same values as `isalpha()` and friends, i.e. “the value of
which shall be representable as an `unsigned char` or shall equal the
value of the macro `EOF`. If the argument has any other value, the
behavior is undefined.” This is a subtle BC break, since the character
`chr(128)` has the value `-1` if `char` is signed, and so likely would
be confused with `EOF` when converted to `int`. We consider this BC
break to be acceptable, since it's rather unlikely that anybody uses
`chr(128)` as escape character, and it easily can be fixed by casting
all `escape` arguments to `unsigned char`.
This patch implements the feature requests 38301[2] and 51496[3].
[1] <https://tools.ietf.org/html/rfc4180>
[2] <https://bugs.php.net/bug.php?id=38301>
[3] <https://bugs.php.net/bug.php?id=51496>
2018-12-02 23:28:18 +08:00
|
|
|
str_getcsv() has been adjusted accordingly (formerly, an empty string was
|
|
|
|
identical to using the default).
|
2019-02-13 11:14:32 +08:00
|
|
|
. proc_open() on Windows can be passed a "create_process_group" option. It
|
|
|
|
is required, if the child process is supposed to handle CTRL events.
|
2019-05-07 08:22:29 +08:00
|
|
|
. password_hash() now accepts nullable string and int as $algo argument.
|
|
|
|
. password_needs_rehash() now accepts nullable string and int as $algo
|
|
|
|
argument.
|
Allow empty $escape to eschew escaping CSV
Albeit CSV is still a widespread data exchange format, it has never been
officially standardized. There exists, however, the “informational” RFC
4180[1] which has no notion of escape characters, but rather defines
`escaped` as strings enclosed in double-quotes where contained
double-quotes have to be doubled. While this concept is supported by
PHP's implementation (`$enclosure`), the `$escape` sometimes interferes,
so that `fgetcsv()` is unable to correctly parse externally generated
CSV, and `fputcsv()` is sometimes generating non-compliant CSV. Since
PHP's `$escape` concept is availble for many years, we cannot drop it
for BC reasons (even though many consider it as bug). Instead we allow
to pass an empty string as `$escape` parameter to the respective
functions, which results in ignoring/omitting any escaping, and as such
is more inline with RFC 4180. It is noteworthy that this is almost no
userland BC break, since formerly most functions did not accept an empty
string, and failed in this case. The only exception was `str_getcsv()`
which did accept an empty string, and used a backslash as escape
character then (which appears to be unintended behavior, anyway).
The changed functions are `fputcsv()`, `fgetcsv()` and `str_getcsv()`,
and also the `::setCsvControl()`, `::getCsvControl()`, `::fputcsv()`,
and `::fgetcsv()` methods of `SplFileObject`.
The implementation also changes the type of the escape parameter of the
PHP_APIs `php_fgetcsv()` and `php_fputcsv()` from `char` to `int`, where
`PHP_CSV_NO_ESCAPE` means to ignore/omit escaping. The parameter
accepts the same values as `isalpha()` and friends, i.e. “the value of
which shall be representable as an `unsigned char` or shall equal the
value of the macro `EOF`. If the argument has any other value, the
behavior is undefined.” This is a subtle BC break, since the character
`chr(128)` has the value `-1` if `char` is signed, and so likely would
be confused with `EOF` when converted to `int`. We consider this BC
break to be acceptable, since it's rather unlikely that anybody uses
`chr(128)` as escape character, and it easily can be fixed by casting
all `escape` arguments to `unsigned char`.
This patch implements the feature requests 38301[2] and 51496[3].
[1] <https://tools.ietf.org/html/rfc4180>
[2] <https://bugs.php.net/bug.php?id=38301>
[3] <https://bugs.php.net/bug.php?id=51496>
2018-12-02 23:28:18 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
6. New Functions
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2015-04-24 23:19:58 +08:00
|
|
|
|
2019-05-14 20:27:10 +08:00
|
|
|
- Core:
|
|
|
|
. Added get_mangled_object_vars($object) function, which returns the mangled
|
|
|
|
object properties. It returns the same result as (array) $object, with the
|
|
|
|
exception that it ignores overloaded array casts, such as used by
|
|
|
|
ArrayObject.
|
|
|
|
|
2019-06-21 05:40:51 +08:00
|
|
|
- GD:
|
2019-07-26 01:23:26 +08:00
|
|
|
. Added imagecreatefromtga() function, which allows reading images in TGA
|
2019-06-21 05:40:51 +08:00
|
|
|
format. TGA support is now also indicated by gd_info() and imagetypes().
|
|
|
|
Note that TGA images are not recognized by imagecreatefromstring() and
|
|
|
|
getimagesize().
|
|
|
|
|
2018-11-15 17:46:48 +08:00
|
|
|
- OpenSSL:
|
|
|
|
. Added openssl_x509_verify(mixed cert, mixed key) function that verifies the
|
|
|
|
signature of the certificate using a public key. A wrapper around the
|
|
|
|
OpenSSL's X509_verify() function.
|
|
|
|
See <https://github.com/php/php-src/pull/3624>.
|
|
|
|
|
2019-02-19 03:58:56 +08:00
|
|
|
- Pcntl:
|
2019-07-26 01:23:26 +08:00
|
|
|
. Added bool pcntl_unshare(int flags) function which allows dissociating
|
2019-02-19 03:58:56 +08:00
|
|
|
parts of the process execution context which are currently being shared with
|
|
|
|
other processes. Explicitly, it allows you to unshare the mount, IPC, UTS,
|
|
|
|
network, PID, user and cgroup namespaces.
|
|
|
|
|
2018-10-18 21:21:10 +08:00
|
|
|
- SQLite3:
|
2019-07-26 01:23:26 +08:00
|
|
|
. Added SQLite3Stmt::getSQL() to retrieve the SQL of the statement. If true is
|
|
|
|
passed as $expanded argument, query parameters will be replaced in the
|
|
|
|
return value by their currently bound value, if libsqlite ≥ 3.14 is used.
|
2019-06-18 05:28:30 +08:00
|
|
|
. Added SQLite3::backup() to create database backups via the SQLite3 online
|
|
|
|
backup API.
|
2018-10-18 21:21:10 +08:00
|
|
|
|
2019-02-13 11:14:32 +08:00
|
|
|
- Standard
|
|
|
|
. bool sapi_windows_set_ctrl_handler(callable handler, [, bool add = true]) -
|
|
|
|
set or remove a handler function upon receiving a CTRL event. The handler
|
2019-07-26 01:23:26 +08:00
|
|
|
function is expected to have this signature: "function handler(int $event)".
|
2019-02-13 11:14:32 +08:00
|
|
|
. bool sapi_windows_generate_ctrl_event(int type, int pid) - send a CTRL event
|
|
|
|
to another process.
|
2019-05-07 08:22:29 +08:00
|
|
|
. array password_algos() - return a complete list of all registered password
|
|
|
|
hashing algorithms. For more details see the RFC:
|
|
|
|
https://wiki.php.net/rfc/password_registry
|
2019-02-13 11:14:32 +08:00
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
7. New Classes and Interfaces
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2018-09-25 02:57:39 +08:00
|
|
|
- Reflection:
|
|
|
|
. A new ReflectionReference class has been added, which allows detecting
|
|
|
|
references and comparing them for identity. For more details see the RFC:
|
|
|
|
https://wiki.php.net/rfc/reference_reflection
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2015-02-10 15:56:18 +08:00
|
|
|
8. Removed Extensions and SAPIs
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
2019-05-02 04:35:30 +08:00
|
|
|
- Interbase:
|
2019-05-06 06:58:21 +08:00
|
|
|
. The interbase extension has been moved to PECL. Access to an InterBase
|
|
|
|
and/or FireBird based database is still available with the PDO_Firebird
|
2019-05-02 04:35:30 +08:00
|
|
|
extension. For more details see the RFC:
|
|
|
|
https://wiki.php.net/rfc/deprecate-and-remove-ext-interbase
|
|
|
|
|
2019-07-12 20:35:44 +08:00
|
|
|
- Recode:
|
|
|
|
. The recode extension has been moved to PECL. For character set/encoding
|
|
|
|
conversion the iconv or mbstring extensions could be used instead.
|
2019-07-13 21:37:36 +08:00
|
|
|
RFC: https://wiki.php.net/rfc/unbundle_recode
|
2019-07-12 20:35:44 +08:00
|
|
|
|
2019-05-06 06:58:21 +08:00
|
|
|
- WDDX:
|
|
|
|
. The WDDX extension has been deprecated and moved to PECL.
|
|
|
|
RFC: https://wiki.php.net/rfc/deprecate-and-remove-ext-wddx
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
9. Other Changes to Extensions
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2016-07-03 18:43:30 +08:00
|
|
|
|
2018-05-15 05:25:37 +08:00
|
|
|
- GD:
|
2018-11-26 06:26:12 +08:00
|
|
|
. The behavior of imagecropauto() in the bundled libgd has been synced with
|
|
|
|
that of system libgd:
|
2018-12-02 06:54:17 +08:00
|
|
|
* IMG_CROP_DEFAULT is no longer falling back to IMG_CROP_SIDES
|
2018-11-26 06:26:12 +08:00
|
|
|
* Threshold-cropping now uses the algorithm of system libgd
|
2018-12-13 00:25:37 +08:00
|
|
|
. The default $mode parameter of imagecropauto() has been changed to
|
|
|
|
IMG_CROP_DEFAULT; passing -1 is now deprecated.
|
2018-12-30 02:41:57 +08:00
|
|
|
. imagescale() now supports aspect ratio preserving scaling to a fixed height
|
|
|
|
by passing -1 as $new_width.
|
2018-05-15 05:25:37 +08:00
|
|
|
|
2019-03-21 02:09:45 +08:00
|
|
|
- Filter:
|
2019-04-20 22:16:18 +08:00
|
|
|
. The filter extension no longer exposes --with-pcre-dir for Unix builds and
|
2019-03-21 02:09:45 +08:00
|
|
|
can now reliably be built as shared when using ./configure once more.
|
|
|
|
|
2018-10-03 14:47:07 +08:00
|
|
|
- Hash:
|
2019-07-26 01:23:26 +08:00
|
|
|
. The hash extension cannot be disabled anymore and is always an integral part
|
|
|
|
of any PHP build, similar to the date extension.
|
2018-10-03 14:47:07 +08:00
|
|
|
|
2018-09-06 20:04:44 +08:00
|
|
|
- Intl:
|
|
|
|
. The Intl extension now requires at least ICU 50.1.
|
2019-05-29 22:45:10 +08:00
|
|
|
. ResourceBundle now implements Countable.
|
2018-09-06 20:04:44 +08:00
|
|
|
|
2018-09-16 17:48:48 +08:00
|
|
|
- Libxml:
|
|
|
|
. All libxml based extensions now require libxml 2.7.6 or newer.
|
|
|
|
|
2019-02-11 21:59:27 +08:00
|
|
|
- Mbstring:
|
|
|
|
. The oniguruma library is no longer bundled with PHP, instead libonig needs
|
|
|
|
to be available on the system. Alternatively --disable-mbregex can be used
|
|
|
|
to disable the mbregex component.
|
|
|
|
|
2019-02-08 07:31:25 +08:00
|
|
|
- OPcache:
|
2019-02-11 02:18:07 +08:00
|
|
|
. The --disable-opcache-file|--enable-opcache-file configure options have been
|
|
|
|
removed in favor of the opcache.file_cache INI directive.
|
2019-02-08 07:31:25 +08:00
|
|
|
|
2019-07-25 22:28:42 +08:00
|
|
|
- PDO:
|
2019-07-28 02:35:42 +08:00
|
|
|
. It is now possible to escape question marks in SQL queries to avoid them
|
2019-07-26 01:23:26 +08:00
|
|
|
being interpreted as parameter placeholders. Writing "??" allows sending
|
2019-07-25 22:28:42 +08:00
|
|
|
a single question mark to the database and e.g. use the PostgreSQL JSON key
|
|
|
|
exists "?" operator. For more details see the RFC:
|
|
|
|
https://wiki.php.net/rfc/pdo_escape_placeholders
|
|
|
|
|
2018-09-11 22:21:17 +08:00
|
|
|
- Reflection:
|
|
|
|
. Numeric value of class, property, function and constant modifiers was
|
|
|
|
changed. Don't filter methods and properties through
|
|
|
|
ReflectionClass::getMethods() and ReflectionClass::getProperties(), or test
|
|
|
|
results of Reflection...::getModifiers(), using hard-coded numeric values.
|
|
|
|
Use corresponding constants instead (e.g. ReflectionMethod::IS_PUBLIC).
|
|
|
|
|
2019-05-29 22:45:10 +08:00
|
|
|
- SimpleXML:
|
|
|
|
. SimpleXMLElement now implements Countable.
|
|
|
|
|
2018-10-06 18:44:50 +08:00
|
|
|
- SQLite3:
|
2019-07-26 01:23:26 +08:00
|
|
|
. The bundled libsqlite has been removed. To build the SQLite3 extension a
|
|
|
|
system libsqlite3 ≥ 3.7.4 is now required. To build the PDO_SQLite extension
|
|
|
|
a system libsqlite3 ≥ 3.5.0 is now required.
|
2019-05-07 08:22:29 +08:00
|
|
|
. (Un)serialization of SQLite3, SQLite3Stmt and SQLite3Result is now
|
|
|
|
explicitly forbidden. Formerly, serialization of instances of these classes
|
|
|
|
was possible, but unserialization yielded unusable objects.
|
2018-11-11 21:55:34 +08:00
|
|
|
. The @param notation can now also be used to denote SQL query parameters.
|
2018-10-06 18:44:50 +08:00
|
|
|
|
2018-09-17 23:24:06 +08:00
|
|
|
- Zip:
|
|
|
|
. The bundled libzip library has been removed. A system libzip >= 0.11 is now
|
|
|
|
necessary to build the extension.
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
10. New Global Constants
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2010-03-25 00:23:50 +08:00
|
|
|
|
2019-02-11 21:59:27 +08:00
|
|
|
- Mbstring:
|
|
|
|
. MB_ONIGURUMA_VERSION specifies the version of the oniguruma library against
|
|
|
|
which mbregex has been built.
|
|
|
|
|
2019-02-07 22:23:27 +08:00
|
|
|
- Socket:
|
|
|
|
. Added FreeBSD-specific socket options:
|
|
|
|
. SO_LABEL
|
|
|
|
. SO_PEERLABEL
|
|
|
|
. SO_LISTENQLIMIT
|
|
|
|
. SO_LISTENQLEN
|
|
|
|
. SO_USER_COOKIE
|
|
|
|
|
2019-02-13 11:14:32 +08:00
|
|
|
- Standard:
|
|
|
|
. PHP_WINDOWS_EVENT_CTRL_C
|
|
|
|
. PHP_WINDOWS_EVENT_CTRL_BREAK
|
|
|
|
|
2018-10-27 22:17:09 +08:00
|
|
|
- Tidy:
|
|
|
|
. TIDY_TAG_ARTICLE
|
|
|
|
. TIDY_TAG_ASIDE
|
|
|
|
. TIDY_TAG_AUDIO
|
|
|
|
. TIDY_TAG_BDI
|
|
|
|
. TIDY_TAG_CANVAS
|
|
|
|
. TIDY_TAG_COMMAND
|
|
|
|
. TIDY_TAG_DATALIST
|
|
|
|
. TIDY_TAG_DETAILS
|
|
|
|
. TIDY_TAG_DIALOG
|
|
|
|
. TIDY_TAG_FIGCAPTION
|
|
|
|
. TIDY_TAG_FIGURE
|
|
|
|
. TIDY_TAG_FOOTER
|
|
|
|
. TIDY_TAG_HEADER
|
|
|
|
. TIDY_TAG_HGROUP
|
|
|
|
. TIDY_TAG_MAIN
|
|
|
|
. TIDY_TAG_MARK
|
|
|
|
. TIDY_TAG_MENUITEM
|
|
|
|
. TIDY_TAG_METER
|
|
|
|
. TIDY_TAG_NAV
|
|
|
|
. TIDY_TAG_OUTPUT
|
|
|
|
. TIDY_TAG_PROGRESS
|
|
|
|
. TIDY_TAG_SECTION
|
|
|
|
. TIDY_TAG_SOURCE
|
|
|
|
. TIDY_TAG_SUMMARY
|
|
|
|
. TIDY_TAG_TEMPLATE
|
|
|
|
. TIDY_TAG_TIME
|
|
|
|
. TIDY_TAG_TRACK
|
|
|
|
. TIDY_TAG_VIDEO
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
11. Changes to INI File Handling
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2010-08-30 17:38:47 +08:00
|
|
|
|
2019-07-09 01:34:47 +08:00
|
|
|
- zend.exception_ignore_args
|
2019-07-26 01:09:21 +08:00
|
|
|
. New INI directive to include or exclude arguments from stack traces
|
2019-07-09 01:34:47 +08:00
|
|
|
generated for exceptions.
|
|
|
|
|
2014-08-22 19:35:07 +08:00
|
|
|
========================================
|
|
|
|
12. Windows Support
|
|
|
|
========================================
|
|
|
|
|
2018-10-04 01:11:31 +08:00
|
|
|
- stat:
|
|
|
|
. The stat implementation has been refactored.
|
|
|
|
- An inode number is delivered and is based on the NTFS file index.
|
|
|
|
- The device number is now based on the volume serial number.
|
|
|
|
|
2019-07-26 01:23:26 +08:00
|
|
|
Note that both values are derived from the system and provided as is on 64-bit
|
|
|
|
systems. On 32-bit systems, these values might overflow the 32-bit integer in
|
|
|
|
PHP, so they're fake.
|
2018-10-04 01:11:31 +08:00
|
|
|
|
2019-02-13 11:14:32 +08:00
|
|
|
- CTRL+C and CTRL+BREAK on console can be caught by setting a handler function
|
2019-04-20 22:16:18 +08:00
|
|
|
with sapi_windows_set_ctrl_handler().
|
2019-02-13 11:14:32 +08:00
|
|
|
|
2019-07-03 01:08:19 +08:00
|
|
|
- configure now regards additional CFLAGS and LDFLAGS set as environment
|
|
|
|
variables.
|
|
|
|
|
2019-07-18 15:16:56 +08:00
|
|
|
- OPcache now supports an arbitrary amount of separate caches per user via the
|
|
|
|
the INI directive opcache.cache_id. All processes with the same cache ID and
|
|
|
|
user share an OPcache instance.
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2019-01-15 17:13:39 +08:00
|
|
|
13. Migration to pkg-config
|
|
|
|
========================================
|
|
|
|
|
2019-07-26 01:23:26 +08:00
|
|
|
A number of extensions have been migrated to exclusively use pkg-config for the
|
|
|
|
detection of library dependencies. Generally, this means that instead of using
|
|
|
|
--with-foo-dir=DIR or similar only --with-foo is used. Custom library paths can
|
|
|
|
be specified either by adding additional directories to PKG_CONFIG_PATH or by
|
|
|
|
explicitly specifying compilation options through FOO_CFLAGS and FOO_LIBS.
|
2019-01-15 17:13:39 +08:00
|
|
|
|
2019-05-10 20:00:39 +08:00
|
|
|
The following extensions and SAPIs are affected:
|
2019-01-15 17:13:39 +08:00
|
|
|
|
|
|
|
- Curl:
|
|
|
|
. --with-curl no longer accepts a directory.
|
|
|
|
|
2019-05-18 01:39:22 +08:00
|
|
|
- Enchant:
|
|
|
|
. --with-enchant no longer accepts a directory.
|
|
|
|
|
2019-05-10 20:00:39 +08:00
|
|
|
- FPM:
|
|
|
|
. --with-fpm-systemd now uses only pkg-config for libsystem checks. The
|
|
|
|
libsystemd minimum required version is 209.
|
|
|
|
|
2019-01-15 17:13:39 +08:00
|
|
|
- GD:
|
2019-01-21 21:01:34 +08:00
|
|
|
. --with-gd becomes --enable-gd (whether to enable the extension at all) and
|
|
|
|
--with-external-gd (to opt into using an external libgd, rather than the
|
|
|
|
bundled one).
|
2019-01-15 17:13:39 +08:00
|
|
|
. --with-png-dir has been removed. libpng is required.
|
|
|
|
. --with-zlib-dir has been removed. zlib is required.
|
|
|
|
. --with-freetype-dir becomes --with-freetype.
|
|
|
|
. --with-jpeg-dir becomes --with-jpeg.
|
|
|
|
. --with-webp-dir becomes --with-webp.
|
|
|
|
. --with-xpm-dir becomes --with-xpm.
|
|
|
|
|
2019-05-14 09:20:03 +08:00
|
|
|
- IMAP:
|
|
|
|
. --with-kerberos no longer accepts a directory.
|
|
|
|
|
|
|
|
- Intl:
|
|
|
|
. --with-icu-dir has been removed. If --enable-intl is passed, then libicu is
|
|
|
|
always required.
|
|
|
|
|
2019-06-05 20:57:09 +08:00
|
|
|
- Ldap:
|
|
|
|
. --with-ldap-sasl no longer accepts a directory.
|
|
|
|
|
2019-04-18 18:09:01 +08:00
|
|
|
- Libxml:
|
|
|
|
. --with-libxml-dir has been removed.
|
|
|
|
. --enable-libxml becomes --with-libxml.
|
2019-07-26 01:23:26 +08:00
|
|
|
. --with-libexpat-dir has been renamed to --with-expat and no longer accepts a
|
|
|
|
directory.
|
2019-04-18 18:09:01 +08:00
|
|
|
|
2019-05-17 09:18:02 +08:00
|
|
|
- LiteSpeed:
|
|
|
|
. --with-litespeed becomes --enable-litespeed.
|
|
|
|
|
2019-05-14 09:20:03 +08:00
|
|
|
- Mbstring:
|
|
|
|
. --with-onig has been removed. Unless --disable-mbregex has been passed,
|
|
|
|
libonig is required.
|
|
|
|
|
2019-05-08 20:32:56 +08:00
|
|
|
- ODBC:
|
|
|
|
. --with-iodbc no longer accepts a directory.
|
2019-07-26 01:23:26 +08:00
|
|
|
. --with-unixODBC without a directory now uses pkg-config (preferred).
|
2019-06-05 16:56:05 +08:00
|
|
|
Directory is still accepted for old versions without libodbc.pc.
|
2019-05-08 20:32:56 +08:00
|
|
|
|
2019-05-14 09:20:03 +08:00
|
|
|
- OpenSSL:
|
|
|
|
. --with-openssl no longer accepts a directory.
|
|
|
|
. --with-kerberos no longer accepts a directory.
|
|
|
|
|
|
|
|
- PCRE:
|
|
|
|
. --with-pcre-regex has been removed. Instead --with-external-pcre is provided
|
|
|
|
to opt into using an external PCRE library, rather than the bundled one.
|
|
|
|
|
|
|
|
- PDO_SQLite:
|
|
|
|
. --with-pdo-sqlite no longer accepts a directory.
|
|
|
|
|
|
|
|
- Readline:
|
|
|
|
. --with-libedit no longer accepts a directory.
|
|
|
|
|
2019-04-29 20:17:44 +08:00
|
|
|
- Sodium:
|
|
|
|
. --with-sodium no longer accepts a directory.
|
|
|
|
|
2019-05-14 09:20:03 +08:00
|
|
|
- SQLite3:
|
|
|
|
. --with-sqlite3 no longer accepts a directory.
|
|
|
|
|
2019-06-06 19:19:19 +08:00
|
|
|
- XSL:
|
|
|
|
. --with-xsl no longer accepts a directory.
|
|
|
|
|
2019-04-29 20:17:44 +08:00
|
|
|
- Zip:
|
|
|
|
. --with-libzip has been removed.
|
|
|
|
. --enable-zip becomes --with-zip.
|
|
|
|
|
2019-01-15 17:13:39 +08:00
|
|
|
========================================
|
|
|
|
14. Other Changes
|
2012-03-06 04:14:04 +08:00
|
|
|
========================================
|
2018-12-27 05:26:01 +08:00
|
|
|
|
|
|
|
========================================
|
2019-01-15 17:13:39 +08:00
|
|
|
15. Performance Improvements
|
2018-12-27 05:26:01 +08:00
|
|
|
========================================
|
|
|
|
|
|
|
|
- Core:
|
|
|
|
. A specialized VM opcode for the array_key_exists() function has been added,
|
|
|
|
which improves performance of this function if it can be statically
|
|
|
|
resolved. In namespaced code, this may require writing \array_key_exists()
|
|
|
|
or explicitly importing the function.
|
2019-03-18 19:57:43 +08:00
|
|
|
|
|
|
|
- PCRE:
|
|
|
|
. When preg_match() in UTF-8 mode ("u" modifier) is repeatedly called on the
|
|
|
|
same string (but possibly different offsets), it will only be checked for
|
|
|
|
UTF-8 validity once.
|