Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Practical PHP7

Practical PHP7

Leszek Krupiński

November 14, 2015
Tweet

More Decks by Leszek Krupiński

Other Decks in Programming

Transcript

  1. The following syntactical elements are removed: • <% opening tag

    • <%= opening tag with echo • %> closing tag • (<script\s+language\s*=\s*(php|"php"|'php') \s*>)i opening tag • (</script>)i closing tag
  2. PHP RFC: Removal of dead or not yet PHP7 ported

    SAPIs and extensions https://wiki.php.net/rfc/removal_of_dead_sapis_and_exts
  3. • sapi/aolserver • sapi/apache • sapi/apache_hooks • sapi/apache2filter • sapi/caudium

    • sapi/continuity • sapi/isapi • sapi/phttpd • sapi/pi3web • sapi/roxen • sapi/thttpd • sapi/tux • sapi/webjames • ext/mssql • ext/sybase_ct
  4. The following language features are deprecated: • Assignment of new

    by reference (since PHP 5.3; use normal assignment instead) REMOVED • Scoped calls of non-static methods from incompatible $this context (since PHP 5.6) REMOVED The following functions are deprecated: • dl on fpm-fcgi (since PHP 5.3) REMOVED • set_magic_quotes_runtime and magic_quotes_runtime (since PHP 5.4) REMOVED • set_socket_blocking (since PHP 5.4; use stream_set_blocking instead) REMOVED • mcrypt_generic_end (since PHP 5.4; use mcrypt_generic_deinit instead) REMOVED • mcrypt_ecb, mcrypt_cbc, mcrypt_cfb and mcrypt_ofb (since PHP 5.5, but documented as deprecated earlier; use mcrypt_encrypt and mcrypt_decrypt instead) REMOVED • datefmt_set_timezone_id and IntlDateFormatter::setTimeZoneID (since PHP 5.5; use datefmt_set_timezone or IntlDateFormatter::setTimeZone instead) REMOVED The following ini options are deprecated: • xsl.security_prefs (since PHP 5.4; use XsltProcessor::setSecurityPrefs instead) REMOVED The following miscellaneous functionality is deprecated: • The $is_dst parameter of the mktime() and gmmktime() functions (since PHP 5.1) REMOVED • # style comments in ini files (since PHP 5.3; use ; style comments instead) REMOVED • String category names in setlocale() (since PHP 5.3; use LC_* constants instead) REMOVED • Unsafe curl file uploads (since PHP 5.5; use CurlFile instead) REMOVED • preg_replace() eval modifier (since PHP 5.5; use preg_replace_callback instead) REMOVED • PDO::PGSQL_ATTR_DISABLE_NATIVE_PREPARED_STAT EMENT driver option (since PHP 5.6; use PDO::ATTR_EMULATE_PREPARES instead) REMOVED • CN_match and SNI_server_name stream context option (since PHP 5.6; use peer_name instead) REMOVED
  5. PHP RFC: Make defining multiple default cases in a switch

    a syntax error https://wiki.php.net/rfc/switch.default.multiple
  6. More! • PHP7 migration guide
 http://php.net/manual/en/migration70.php • PHP7 tutorial
 http://php7-tutorial.com

    • PHP7 Compatibility Checker
 https://github.com/sstalle/php7cc • PHP7 RFCs
 https://wiki.php.net/rfc#php_70 • PHP7 Vagrant Boxes
 https://github.com/rlerdorf/php7dev • Upgrading to PHP7 free ebook
 http://www.oreilly.com/web-platform/free/upgrading-to-php- seven.csp