eBook - PHP 7 explained

What you will learn:

  • Why the successor of PHP 5 is version 7
  • How to migrate with ease
  • Why PHP 7 is the fastest PHP ever
  • How to use all new features
  • What is planned for future versions
  • How PHP 7 will change how you write code

Sample Pages

Table of Contents

  • Preface
    • About the Authors
      • Sebastian Bergmann
      • Arne Blankerts
      • Stefan Priebsch
    • About thePHP.cc
    • Acknowledgments
  • Introduction
    • The Road to PHP 7
    • The Modernization of PHP
    • The Price You Pay
      • Uniform Variable Syntax
      • New Reserved Words
      • foreach()
      • Parameter Handling
    • What You Get
  • Behind the Scenes
    • Compiler
      • Lexical Analysis
      • Syntactic Analysis
      • Bytecode Generation
    • Executor
    • Bytecode Cache
    • Debugger
  • Getting PHP 7
    • RHEL and CentOS
      • RHEL 7 and CentOS 7
      • RHEL 6 and CentOS 6
      • RHEL 5 and CentOS 5
    • Debian
      • Debian Jessie
      • Debian Wheezy
      • Debian Squeeze
    • Ubuntu
    • MacOS X
      • Homebrew
      • MacPorts
    • Microsoft Windows
  • Broken code you should not have written
    • Casting INF and NAN to Integer
    • Invalid list() Usage
    • Parsing Invalid Octal Numbers
    • Architecture-Independent Bit Shifting
    • No More Cheating Using Parentheses
    • Identical Parameter Names Are No Longer Allowed
    • Variable Variables Are No Longer Allowed In global Declarations
    • Only One Default Block In switch Statements
    • Nested Output Buffers and Callbacks
    • Calling Functions and Methods With Too Few Arguments
    • Cleaned Up $this Handling
  • Type System
    • Scalar Type Declarations
      • History
      • Coercive Scalar Type Declarations
      • Strict Scalar Type Declarations
    • Nullable Types
    • New iterable Super-Type
    • Return Type Declarations
    • MySQL and Native Types
    • Typed Values from ini Files
    • The PHP_INT_MIN Constant
  • Convenience
    • Group Use Declarations
    • Null Coalesce Operator
    • Combined Comparison Operator
    • preg_replace_callback_array()
    • Optional Level Parameter for dirname()
    • Cryptographically Secure Pseudo-Random Number Generator (CSPRNG)
    • Closure::call()
  • New
    • Anonymous Classes
    • Assertions
    • Unicode Code Point Escape Syntax
    • OpenSSL
    • Output Buffering and ignore_user_abort()
    • gmp_random_seed()
    • Integer Division
    • JIT Support for Regular Expressions
    • Class Constant Visibility
    • Asynchronous Signal Handling
    • Session Garbage Collection
  • Extended
    • Generators
      • Generator Return Expressions
      • Generator Delegation
      • yield in Expression Context
    • Reflection API
      • Scalar Type Declarations
      • Return Type Declarations
      • Generators
    • Secure unserialize()
    • array_column()
    • Arrays as Constant Values
    • session_start()
    • Session ID Without Hashing
    • Stream-Based Compression
    • Zip
    • Short List Syntax
    • Specifying Keys in list()
    • list() and ArrayAccess
    • Negative String Offsets
  • Error Handling
    • Engine Exceptions
    • Parse Errors
    • Parse Errors in eval()ed Code
    • Recoverable Fatal Errors
    • Method Call on Non-Object
    • Errors in Extensions
    • Constructors of Internal Classes
    • Changed Error Messages
    • debug_zval_dump()
    • error_clear_last()
    • Changed E_STRICT Notices
      • Using Resources as Keys
      • Signature Mismatch During Inheritance
      • Static versus Non-Static Access
      • Only Variables Should Be Assigned or Passed By Reference
    • setcookie() and Empty Names
    • Handling Multiple Exception Types Using a Single Catch Statement
  • Windows
    • Consistent 64-bit Support
    • Streams
    • proc_open()
    • getrusage()
    • memory_limit
  • Breaking Changes
    • Division by Zero
    • Changes to String Handling
    • Changed Order for list() when Assigning to Array
    • New Implementation for JSON Encoding and Decoding
    • Return Value of substr() Changed in an Edge Case
    • Optional Last Parameter of mktime() Removed
    • Safe Uploads Cannot Be Disabled in cURL Extension
    • gmp_setbit() and gmp_clrbit() Return false for Negative Index
    • Deprecated Aliases Removed from the intl Extension
    • PDO, PostgreSQL, and Prepared Statements
    • Removed setlocale() String Category Support
    • Removed set_socket_blocking()
    • Removed XSL ini Option xsl.security_prefs
    • Removed Support for PostScript Type1 Fonts from GD Extension
    • Tick Functions Stopped Working
    • Dynamic Calls to Scope Introspection Functions
    • More Precise Float Value Handling
    • Operators and Invalid Strings
    • Static Methods and ReflectionMethod::invoke()
  • Gone
    • Assigning the Result of new by Reference
    • Static Calls of Instance Methods
    • Accessing Raw POST Data
    • Hash-Sign Comments in ini Files
    • Server APIs (SAPIs)
    • ASP Tags
    • Extensions
    • Magic Quotes
    • Dynamic Extension Loading in PHP-FPM
    • call_user_method()
    • preg_replace() /e modifier
    • Eval Option for mb_ereg_replace() Deprecated
  • Beyond PHP 7

ChangeLog

2017-02-07

Added

  • [] Operator and Empty Strings” section
  • DateTime, DateTimeImmutable, and Microseconds” section
  • Explanation of how inheritance affects nullable parameter type declarations
  • Explanation of nullable return type declarations
  • Information on PHP 7.1 support timeline

Changed

  • Moved discussion of inheritance rules affecting the nullability of return types after the introduction of return type declarations
  • Consistent use of stdClass instead of StdClass
  • Consistent use of “macOS” instead of “MacOS X”

Fixed

  • Discussion of coercive and strict interpretation of return type declarations
  • Type error in the example in the asynchronous signal handling section
  • Spelling mistakes

2016-11-14

Added

  • Example for ReflectionParameter::allowsNull()
  • Explanation of the difference between direct queries and prepared statements in the section on MySQL and native types

Changed

  • Examples for Reflection API related to nullable types

Fixed

  • Example in the section on the iterable super-type
  • Spelling mistakes

2016-10-04

Initial release

Authors

Book

Reviews

Buy

Download