Skip to content

Instantly share code, notes, and snippets.

@tpunt
Last active October 8, 2018 06:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpunt/d9fd57c87c37a06a1057e970a90cd8df to your computer and use it in GitHub Desktop.
Save tpunt/d9fd57c87c37a06a1057e970a90cd8df to your computer and use it in GitHub Desktop.
PHP 7.2 Migration Guide ToDo's

Incompatibilities:

  • Session:
    • Removed register_globals related code and "!" can be used as $_SESSION key name.
    • Session is made to manage session status correctly and prevents invalid operations. Only inappropriate codes are affected by this change. If you have problems with this, it means you have problem in your code.
      • Functions are made to set or return correct session status. session_start(), session_status(), session_regenerate_id()
      • Functions are made to return bool from null. These functions have void parameter and void parameter is checked. session_unset(), session_write_close()/session_commit(), session_abort(), session_reset()
      • Functions prohibit invalid operations with regard to session status and HTTP header status, returns correct bool return value. session_start(), session_set_cookie_params(), session_name(), session_module_name(), session_set_save_handler(), session_regenerate_id(), session_cache_limiter(), session_cache_expire(), session_unset(), session_destroy(), session_write_close()/session_commit(), session_reset()
      • INI value change by ini_set() returns update status correctly. Invalid INI modifications are checked and made to fail. session.name, session.save_path, session.cookie_lifetime, session.cookie_path, session.cookie_domain, session.cookie_httponly, session.cookie_secure, session.use_cookies, session.use_only_cookies, session.use_strict_mode, session.referer_check, session.cache_limiter, session.cache_expire, session.lazy_write, session.save_handler, session.serialize_handler, session.gc_probability, session.gc_divior, session.gc_maxlifetime,
      • Some E_ERRORs are changed to E_WARNING since session status is managed correctly. session_start()
      • Session no longer initialize $_SESSION for invalid and useless session. session_start()
      • When headers are already sent and try to set new INI values, session_name(), session_module_name(), session_save_path(), session_cache_limiter() and session_cache_expire() are no longer works. Older PHPs accepts new values even if new values will not be effective. This new corrected behavior may affect command line mode CLI scripts that manage sessions. Use output buffer just like web applications to resolve problems on CLI scripts.

New Features:

  • DBA:

    • Implemented support for the LMDB backend.
  • JSON:

    • Added JSON_INVALID_UTF8_IGNORE and JSON_INVALID_UTF8_SUBSTITUTE options for json_encode() and json_decode() to ignore and replace invalid UTF-8 byte sequences, respectively.
  • OCI8:

    • Added Oracle Database Transparent Application Failover (TAF) callback support.
  • PCRE:

    • Added J modifier for setting PCRE_DUPNAMES.
    • Added PREG_UNMATCHED_AS_NULL flag to allow distinguish between unmatched subpatterns and empty matches by reporting NULL and "" (empty string), respectively.
  • SQLite3:

    • Implemented writing to BLOBs.
  • Zip:

    • read/write encrypted archive, relying on libzip 1.2.0, using new methods: ZipArchive::setEncryptionName($name, $method [, $password]); ZipArchive::setEncryptionIndex($index, $method [, $password]); and new constants: ZipArchive::EM_NONE ZipArchive::EM_AES_128 ZipArchive::EM_AES_192 ZipArchive::EM_AES_256
    • accept 'password' from zip stream context
    • ZipArchive implements countable, added ZipArchive::count() method.
  • mail()/mb_send_mail() accept array $extra_header. Array parameter is checked against RFC 2822.

Other Changes

  • Mcrypt:

    • The deprecated mcrypt extension has been moved to PECL.
    • libmcrypt has not been maintained since 2007 and the continued use of this extension is strongly discouraged.
    • Users are advised to use alternatives such as OpenSSL or libsodium.
  • EXIF:

    • Added extended exif tag support for the following formats: Samsung, DJI, Panasonic, Sony, Pentax, Minolta, Sigma/Foveon, AGFA, Kyocera, Ricoh & Epson.
    • exif_read_data() and exif_thumbnail() now supports a passed streams as their first parameter.
  • GD:

    • Removed --enable-gd-native-ttf configuration option which was unused as of PHP 5.5.0 anyway.
    • imagegd() stores truecolor images as real truecolor images. Formerly, they have been converted to palette.
    • imageantialias() is now also available if compiled with a system libgd.
  • Mbstring

    • mb_check_encoding() accepts array parameter. Both key and value encodings are checked recursively.
    • mb_convert_encoding() accepts array parameter. Only value encodings are converted recursively.
  • PDO_OCI:

    • The '--with-pdo-oci' configure syntax no longer needs the vesion number of the Oracle Instant Client.
  • pdo_sqlite

    • Use sqlite3_prepare_v2() and sqlite3_close_v2() functions instead of their legacy counterparts.
  • Support for VT100 console mode On systems starting with 10.0.10586, cmd.exe supports ANSI escape sequences. The corresponding console mode is enabled by default on CLI on suitable systems. As well, the function sapi_windows_vt100_support() is provided, to control and query the corresponding information in the scripts.

  • Build system Autoconf minimal version is now 2.64.

@KalleZ
Copy link

KalleZ commented Nov 27, 2017

It should be noted for the VT100 support, the version number is meant for Windows NT 10.0.10586 (aka. Windows 10 (TH2))

@tigusigalpa
Copy link

opcache.fast_shutdown REMOVED
session.hash_function REMOVED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment