PHP 8 Revealed - Use Attributes, the JIT Compiler, Union Types, and More for Web Development

Discover the new and updated features of PHP 8, such as the JIT compiler, union types, and attributes, with code examples of each. For each feature, the author includes real-life cases for its use and explains its benefits.

Uloženo v:
Podrobná bibliografie
Hlavní autor: Engebreth, Gunnard
Médium: E-kniha
Jazyk:angličtina
Vydáno: Berkeley, CA Apress, an imprint of Springer Nature 2021
Apress
Apress L. P
Vydání:1
Témata:
ISBN:9781484268179, 1484268172, 1484268180, 9781484268186
On-line přístup:Získat plný text
Tagy: Přidat tag
Žádné tagy, Buďte první, kdo vytvoří štítek k tomuto záznamu!
Obsah:
  • Title Page Introduction Table of Contents 1. JIT Compiler 2. Union Types V2 3. Named Arguments 4. Reclassifying Engine Warnings, or How I Learned to Stop Worrying and Log the Bugs 5. Nullsafe Operator 6. Attributes V2 7. Match Expression v2 8. Mixed Type v2 9. Weak Maps 10. New str_begins_with() and str_ends_with() 11. Str_contains 12. Bug Fixes 13. Miscellaneous Additions Index
  • Intro -- Table of Contents -- About the Author -- About the Technical Reviewer -- Acknowledgments -- Introduction -- Chapter 1: JIT Compiler -- JIT php.ini Settings -- opcache.jit_buffer_size -- opcache.jit -- opcache.jit_debug -- JIT Debugging -- Chapter 2: Union Types V2 -- Type Handling -- Void and Null Types -- Redundant Types -- Variance -- Adding and Removing Union Types -- Variance of Individual Union Members -- Coercive Typing Mode -- Alternatives -- Property Types and References -- Reflection -- Statistics and Conclusions -- Chapter 3: Named Arguments -- Benefits -- Skipping Defaults -- Self-Documenting Code -- Object Initialization -- Constraints -- Variadic Functions and Argument Unpacking -- Function Handling Functions -- call_user_func() and call_user_func_array() -- __call() -- Parameter Name Changes During Inheritance -- Chapter 4: Reclassifying Engine Warnings, or How I Learned to Stop Worrying and Log the Bugs -- Chapter 5: Nullsafe Operator -- Short Circuiting -- The Benefits -- Forbidden Uses -- Writing -- References -- Chapter 6: Attributes V2 -- Attribute Names Resolve to Classes -- Attribute Fetching -- Compiler and Userland Attributes -- Attribute Use Cases -- Chapter 7: Match Expression v2 -- Return Values -- Switch vs. Match -- No Type Coercion -- No Fallthrough -- Exhaustiveness -- Chapter 8: Mixed Type v2 -- Chapter 9: Weak Maps -- Chapter 10: New str_begins_with() and str_ends_with() -- Chapter 11: Str_contains -- Chapter 12: Bug Fixes -- Stricter Type Checks for Arithmetic/Bitwise Operators -- Change Default PDO Error Mode -- Treat Namespaced Names as Single Token -- Saner String to Number Comparisons -- Ensure Correct Signatures of Magic Methods -- Allow Trailing Comma in Closure Use Lists -- Remove Inappropriate Inheritance Signature Checks on Private Methods -- Saner Numeric Strings -- The Problem -- Proposal
  • Make Sorting Stable -- Chapter 13: Miscellaneous Additions -- Class Constructor Property Promotion -- Constraints -- New fdiv() Function -- Always Generate Fatal Error for Incompatible Method Signatures -- Arrays Starting with a Negative Index -- Implement New DOM Living Standard APIs in ext/dom -- Implement -- Static Return Type -- Variable Syntax Tweaks -- Interpolated and Noninterpolated Strings -- Magic, Class, and Regular Constants -- Class Constant Dereferenceability -- Arbitrary Expression Support for new and instanceof -- Add Stringable Interface -- get_debug_type -- New preg_last_error_msg() -- Add CMS Support -- Allow::class on Objects -- Object-Based token_get_all() Alternative -- Validation for Abstract Trait Methods -- Throw Expression -- Locale-Independent Float to String Cast -- Noncapturing Catches -- Always Available JSON Extension -- zend.exception_string_param_max_len: Configurable String Length in getTraceAsString() -- Unbundle ext/xmlrpc -- Don't Automatically Unserialize Phar Metadata Outside getMetadata() -- The Proposal -- Backward-Incompatible Changes -- Index