From e90e9ce9c8475b8d9b38837a210c1fe5d2ccfb98 Mon Sep 17 00:00:00 2001 From: Peter Cowburn Date: Thu, 12 Sep 2019 06:53:54 +0000 Subject: [PATCH] wip - migration74 appendix git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347981 c90b9560-bf6c-de11-be94-00142212c4b1 --- appendices/migration74.xml | 53 +++ appendices/migration74/constants.xml | 32 ++ appendices/migration74/deprecated.xml | 32 ++ appendices/migration74/incompatible.xml | 32 ++ appendices/migration74/new-features.xml | 398 +++++++++++++++++++++ appendices/migration74/new-functions.xml | 32 ++ appendices/migration74/other-changes.xml | 32 ++ appendices/migration74/windows-support.xml | 32 ++ 8 files changed, 643 insertions(+) create mode 100644 appendices/migration74.xml create mode 100644 appendices/migration74/constants.xml create mode 100644 appendices/migration74/deprecated.xml create mode 100644 appendices/migration74/incompatible.xml create mode 100644 appendices/migration74/new-features.xml create mode 100644 appendices/migration74/new-functions.xml create mode 100644 appendices/migration74/other-changes.xml create mode 100644 appendices/migration74/windows-support.xml diff --git a/appendices/migration74.xml b/appendices/migration74.xml new file mode 100644 index 0000000000..f434e979dc --- /dev/null +++ b/appendices/migration74.xml @@ -0,0 +1,53 @@ + + + + + Migrating from PHP 7.3.x to PHP 7.4.x + + &appendices.migration74.new-features; + &appendices.migration74.new-functions; + &appendices.migration74.constants; + &appendices.migration74.incompatible; + &appendices.migration74.deprecated; + &appendices.migration74.other-changes; + &appendices.migration74.windows-support; + + + + This new minor version brings with it a number of + new features and a + few incompatibilities + that should be tested for before switching PHP versions in production + environments. + + + + &manual.migration.seealso; + 7.0.x, + 7.1.x, + 7.2.x and + 7.3.x. + + + + + diff --git a/appendices/migration74/constants.xml b/appendices/migration74/constants.xml new file mode 100644 index 0000000000..612089b834 --- /dev/null +++ b/appendices/migration74/constants.xml @@ -0,0 +1,32 @@ + + + + + New Global Constants + + + + + + + + diff --git a/appendices/migration74/deprecated.xml b/appendices/migration74/deprecated.xml new file mode 100644 index 0000000000..d208de3e54 --- /dev/null +++ b/appendices/migration74/deprecated.xml @@ -0,0 +1,32 @@ + + + + + Deprecated Features + + + + + + + + diff --git a/appendices/migration74/incompatible.xml b/appendices/migration74/incompatible.xml new file mode 100644 index 0000000000..75e9b8d9be --- /dev/null +++ b/appendices/migration74/incompatible.xml @@ -0,0 +1,32 @@ + + + + + Backward Incompatible Changes + + + + + + + + diff --git a/appendices/migration74/new-features.xml b/appendices/migration74/new-features.xml new file mode 100644 index 0000000000..9d23d3f9bf --- /dev/null +++ b/appendices/migration74/new-features.xml @@ -0,0 +1,398 @@ + + + + + New Features + + + PHP Core + + + Typed properties + + + Class properties now support type declarations. + + + +]]> + + + The above example will enforce that $user->id can only be + assigned integer values and $user->name can + only be assigned string values. + + + + + Arrow functions + + + Arrow functions provide a shorthand syntax for defining functions + with implicit by-value scope binding. + + + + $n * $factor, [1, 2, 3, 4]); +// $nums = array(10, 20, 30, 40); +?> +]]> + + + + + + + Limited return type covariance and argument type contravariance + + + The following code will now work: + + + +]]> + + + 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. + + + + + Null coalescing assignment operator + + + + + +]]> + + + + + + + Unpacking inside arrays + + + + + +]]> + + + + + + + Numeric literal separator + + + Numeric literals can contain underscores between digits. + + + +]]> + + + + + + + Weak references + + + Weak references allow the programmer to retain a reference to an object + that does not prevent the object from being destroyed. + + + + + Allow exceptions from __toString() + + + Throwing exceptions from __toString() + is now permitted. Previously this resulted in a fatal error. Existing + recoverable fatal errors in string conversions have been converted to + Error exceptions. + + + + + + + CURL + + + CURLFile now supports stream wrappers in addition + to plain file names, if the extension has been built against libcurl >= 7.56.0. + + + + + Filter + + + The FILTER_VALIDATE_FLOAT filter now supports the + min_range and max_range + options, with the same semantics as FILTER_VALIDATE_INT. + + + + + FFI + + + FFI is a new extension, which provides a simple way to call + native functions, access native variables, and create/access + data structures defined in C libraries. + + + + + GD + + + Added the IMG_FILTER_SCATTER image filter + to apply a scatter filter to images. + + + + + Hash + + + Added crc32c hash using Castagnoli's polynomial. + This crc32 variant is used by storage systems, such as + iSCSI, SCTP, Btrfs and ext4. + + + + + Multibyte String Functions + + + Added the mb_str_split function, which provides + the same functionality as str_split, but operating + on code points rather than bytes. + + + + + OPcache + + + Support for preloading code has been added. + + + + + 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. + + + + + 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. + + + + + PDO_OCI + + + PDOStatement::getColumnMeta is now available. + + + + + PDO_SQLite + + + PDOStatement::getAttribute(PDO::SQLITE_ATTR_READONLY_STATEMENT) + allows checking whether the statement is read-only, i.e. if it doesn't modify + the database. + + + PDO::setAttribute(PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES, true) + enables the use of SQLite3 extended result codes in errorInfo(). + + + + + SQLite3 + + + Added SQLite3::lastExtendedErrorCode + to fetch the last extended result code. + + + Added SQLite3::enableExtendedResultCodes($enable = true), + which will make SQLite3::lastErrorCode + return extended result codes. + + + + + Standard + + + strip_tags() with array of tag names + + 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']). + + + + + Custom object serialization + + A new mechanism for custom object serialization has been added, which + uses two new magic methods: __serialize + and __unserialize. + + + +]]> + + + The new serialization mechanism supersedes the + Serializable interface, + which will be deprecated in the future. + + + + + Array merge functions without arguments + + 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). + + + + + Array merge functions without arguments + + 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 now supports + redirect and null descriptors. + + +&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); +?> +]]> + + + + + + + argon2i(d) without libargon + + password_hash now has the argon2i and argin2id implementations + from the sodium extension when PHP is built without libargon. + + + + + + + + diff --git a/appendices/migration74/new-functions.xml b/appendices/migration74/new-functions.xml new file mode 100644 index 0000000000..77e732af99 --- /dev/null +++ b/appendices/migration74/new-functions.xml @@ -0,0 +1,32 @@ + + + + + New Functions + + + + + + + + diff --git a/appendices/migration74/other-changes.xml b/appendices/migration74/other-changes.xml new file mode 100644 index 0000000000..696caa81e9 --- /dev/null +++ b/appendices/migration74/other-changes.xml @@ -0,0 +1,32 @@ + + + + + Other Changes + + + + + + + + diff --git a/appendices/migration74/windows-support.xml b/appendices/migration74/windows-support.xml new file mode 100644 index 0000000000..bb9af8cfee --- /dev/null +++ b/appendices/migration74/windows-support.xml @@ -0,0 +1,32 @@ + + + + + Windows Support + + + + + + + +