دسترسی نامحدود
برای کاربرانی که ثبت نام کرده اند
برای ارتباط با ما می توانید از طریق شماره موبایل زیر از طریق تماس و پیامک با ما در ارتباط باشید
در صورت عدم پاسخ گویی از طریق پیامک با پشتیبان در ارتباط باشید
برای کاربرانی که ثبت نام کرده اند
درصورت عدم همخوانی توضیحات با کتاب
از ساعت 7 صبح تا 10 شب
ویرایش:
نویسندگان: Doug Bierer
سری:
ISBN (شابک) : 9781801071871
ناشر: Packt Publishing Pvt Ltd
سال نشر: 2021
تعداد صفحات: 0
زبان: English
فرمت فایل : EPUB (درصورت درخواست کاربر به PDF، EPUB یا AZW3 تبدیل می شود)
حجم فایل: 9 مگابایت
در صورت تبدیل فایل کتاب PHP 8 Programming Tips, Tricks and Best Practices به فرمت های PDF، EPUB، AZW3، MOBI و یا DJVU می توانید به پشتیبان اطلاع دهید تا فایل مورد نظر را تبدیل نمایند.
توجه داشته باشید کتاب نکات، ترفندها و بهترین روش های برنامه نویسی PHP 8 نسخه زبان اصلی می باشد و کتاب ترجمه شده به فارسی نمی باشد. وبسایت اینترنشنال لایبرری ارائه دهنده کتاب های زبان اصلی می باشد و هیچ گونه کتاب ترجمه شده یا نوشته شده به فارسی را ارائه نمی دهد.
تکنیکهای مؤثر، راهحلها و راهنماییهای متخصص را برای جلوگیری از موقعیتهایی که ممکن است برنامه شما به دنبال مهاجرت PHP 8 خراب شود، کشف کنید. در PHP 8* یک روند جدید هیجان انگیز را کاوش کنید - برنامه نویسی ناهمزمان PHP با استفاده از Swoole و FibersBook Description: به لطف سهولت استفاده، PHP یک زبان برنامه نویسی بسیار محبوب است که در بیش از 78٪ از تمام وب سرورهای متصل به اینترنت استفاده می شود. نکات، ترفندها و بهترین روش های برنامه نویسی PHP 8 به شما کمک می کند تا به سرعت با PHP 8 به سرعت به روز شوید. این کتاب برای هر توسعهدهنده PHP در نظر گرفته شده است که میخواهد با ویژگیهای جالب جدید موجود در PHP 8 آشنا شود، و مناطقی را پوشش میدهد که توسعهدهندگان ممکن است پس از بهروزرسانی PHP 8 با مشکلات سازگاری با کدهای موجود خود مواجه شوند. این کتاب بهطور کامل بهترین شیوهها را بررسی میکند، و راههایی را برجسته میکند که در آن PHP 8 این اقدامات را به شیوهای بسیار دقیقتر از نسخههای قبلی خود اعمال میکند. به دنبال پیشرفت در سطح رویه. سپس در مورد خرابی های بالقوه سازگار با عقب و کشف بهترین روش ها برای بهبود عملکرد خواهید آموخت. فصل آخر کتاب با ارائه پوشش دقیق و نمونه هایی از برنامه نویسی ناهمزمان با استفاده از پسوند Swoole و Fibers، بینش هایی در مورد PHP async، یک روش انقلابی جدید برنامه نویسی به شما می دهد. در پایان این کتاب PHP، شما نه تنها خواهید داشت. بر ویژگیهای جدید تسلط دارید، اما همچنین میدانید هنگام انتقال برنامههای قدیمیتر PHP به PHP 8 باید مراقب چه مواردی باشید. آنچه یاد خواهید گرفت* درک جامعی از ویژگیهای شی گرا جدید PHP 8 به دست آورید* رویههای جدید PHP 8 را کشف کنید پیشرفتهای برنامهنویسی* درک پیشرفتها در مدیریت خطا در PHP 8* شناسایی مشکلات احتمالی سازگاری با عقب** از تلهها به دلیل تغییرات در پسوندهای PHP اجتناب کنید* ببینید کدام ویژگیها در PHP 8 منسوخ شده و/یا حذف شدهاند* با بهترین شیوههای برنامهنویسی آشنا شوید اجرا شده توسط PHP 8 این کتاب برای چه کسی است این کتاب برای توسعه دهندگان PHP در تمام سطوحی است که تجربه PHP 5 یا بالاتر را دارند. اگر به تازگی با PHP شروع کرده اید، نمونه کدهای آن را برای یادگیری زبان مفید خواهید یافت. توسعه دهندگانی که برای چند ماه روی یک یا چند پروژه PHP کار کرده اند، می توانند نکات و تکنیک ها را در کدهای موجود به کار ببرند، در حالی که کسانی که سال ها تجربه PHP دارند، مطمئناً از پوشش مختصر ویژگی های جدید PHP 8 قدردانی می کنند.
Discover effective techniques, workarounds, and expert guidance for avoiding situations where your application might break following PHP 8 migrationKey Features* Get the hang of all the new features introduced in PHP 8* Learn how to detect potential code breaks and keep your application code running smoothly in PHP 8* Explore an exciting new trend - asynchronous PHP programming using Swoole and FibersBook DescriptionThanks to its ease of use, PHP is a highly popular programming language used on over 78% of all web servers connected to the Internet. PHP 8 Programming Tips, Tricks, and Best Practices will help you to get up-to-speed with PHP 8 quickly. The book is intended for any PHP developer who wants to become familiar with the cool new features available in PHP 8, and covers areas where developers might experience backward compatibility issues with their existing code after a PHP 8 update. The book thoroughly explores best practices, and highlights ways in which PHP 8 enforces these practices in a much more rigorous fashion than its earlier versions.You'll start by exploring new PHP 8 features in the area of object-oriented programming (OOP), followed by enhancements at the procedural level. You'll then learn about potential backward compatible breaks and discover best practices for improving performance. The last chapter of the book gives you insights into PHP async, a revolutionary new way of programming, by providing detailed coverage and examples of asynchronous programming using the Swoole extension and Fibers.By the end of this PHP book, you'll not only have mastered the new features, but you'll also know exactly what to watch out for when migrating older PHP applications to PHP 8.What you will learn* Gain a comprehensive understanding of the new PHP 8 object-oriented features* Discover new PHP 8 procedural programming enhancements* Understand improvements in error handling in PHP 8* Identify potential backward compatibility issues* Avoid traps due to changes in PHP extensions* Find out which features have been deprecated and/or removed in PHP 8* Become well-versed with programming best practices enforced by PHP 8Who this book is forThis book is for PHP developers at all levels who have experience in PHP 5 or above. If you're just getting started with PHP, you'll find the code examples useful for learning the language. Developers who have worked for a few months on one or more PHP projects will be able to apply the tips and techniques to the code at hand, while those with many years of PHP experience are sure to appreciate the concise coverage of new PHP 8 features.
Cover Title page Copyright and Credits Foreword Contributors Table of Contents Preface Section 1: PHP 8 Tips Chapter 1: Introducing New PHP 8 OOP Features Technical requirements Using constructor property promotion Property promotion syntax Using property promotion for code reduction Working with attributes Overview of PHP comments PHP DocBlock considerations Hidden dangers associated with the misuse of DocBlocks The Attribute class Attribute syntax Incorporating match expressions into your program code Match expression general syntax Understanding named arguments Named argument generic syntax Calling core functions using named arguments Order independence and documentation Exploring new data types Union types mixed type The effect of a mixed type on inheritance Improving code using typed properties What are typed properties? Property typing can lead to a reduction in code Summary Chapter 2: Learning about PHP 8's Functional Additions Technical requirements Working with new PHP 8 operators Using the variadics operator Using the nullsafe operator The concatenation operator has been demoted Using nested ternary operators Using arrow functions Generic syntax Arrow functions versus anonymous functions Variable inheritance Practical example: Using arrow functions Understanding uniform variable syntax Defining uniform variable syntax How does uniform variable syntax affect PHP 8? Learning new array- and string-handling techniques Working with array_splice() Using array_slice() Detecting string beginning, middle, and end Securing SQLite databases with the authorizer Wait a minute... no security? What's a SQLite authorization callback? What gets sent to the callback? Authorizer usage example Summary Chapter 3: Taking Advantage of Error-Handling Enhancements Technical requirements Understanding PHP 8 error handling Undefined variable handling Undefined constant handling Error-level defaults Dealing with warnings that are now errors Promoted warnings in object error handling Promoted warnings in array handling Promoted warnings in string handling Understanding notices promoted to warnings Non-existent object property access handling Non-existent offset handling Misusing resource IDs as array offsets Ambiguous string offset cast Uninitialized or non-existent string offsets Handling the @ error control operator @ operator usage @ operator and error_reporting() Summary Chapter 4: Making Direct C-Language Calls Technical requirements Understanding FFI Relationship between PHP and the C language Understanding PHP extensions Learning where to use FFI Adopting FFI into PHP Do not use FFI for speed Why use the FFI extension? Examining the FFI class Working with FFI creational methods Comparing data using FFI Using FFI infrastructural methods Using FFI in an application Integrating an external C library into a PHP script Working with PHP callbacks Summary Section 2: PHP 8 Tricks Chapter 5: Discovering Potential OOP Backward-Compatibility Breaks Technical requirements Discovering core OOP coding differences Handling static calls in PHP 8 Dealing with object property handling changes Working with PHP 8 autoloading Navigating changes in magic methods Dealing with constructor changes Working with changes to __toString() Taking control of serialization Understanding PHP serialization Understanding the __sleep() magic method Understanding a potential code break in the __sleep() method Learning about __wakeup() Introducing the Serializable interface Examining PHP serializable interface issues New magic methods to control PHP serialization Understanding PHP 8 expanded variance support Understanding covariant returns Using contravariant parameters Handling Standard PHP Library (SPL) changes Understanding changes to SplFileObject Examining changes to SplHeap Handling changes in SplDoublyLinkedList Summary Chapter 6: Understanding PHP 8 Functional Differences Technical requirements Learning key advanced string handling differences Handling changes to the needle argument Dealing with v*printf() changes Working with null length arguments in PHP 8 Examining changes to implode() Learning about constants usage in PHP 8 Understanding PHP 8 string-to-numeric comparison improvements Learning about strict and non-strict comparisons Examining numeric strings Detecting backward-compatible breaks involving numeric strings Dealing with inconsistent string-to-numeric comparison results Understanding comparison changes made in PHP 8 Avoiding problems during a PHP 8 upgrade Handling differences in arithmetic, bitwise, and concatenation operations Handling non-scalar data types in arithmetic and bitwise operations Examining changes in the order of precedence Taking advantage of locale independence Understanding the problems associated with locale dependence Reviewing functions and operations affected by locale independence Handling arrays in PHP 8 Dealing with negative offsets Handling curly brace usage changes Mastering changes in security functions and settings Understanding changes in disabled functions handling Learning about changes to the crypt() function Dealing with changes to password_hash() Learning about changes to assert() Summary Chapter 7: Avoiding Traps When Using PHP 8 Extensions Technical requirements Understanding the shift from resources to objects PHP 8 extension resource-to-object migration Potential code break involving is_resource() Advantages of objects over resources Traversable to IteratorAggregate migration Learning about changes to XML extensions Examining XMLWriter extension differences Working with changes to the SimpleXML extension Understanding other XML extension changes Avoiding problems with the updated mbstring extension Discovering needle-argument differences in mb_str*() functions Examining changes to mb_ereg*() functions Dealing with changes to the GD extension GD extension resource-to-object migration GD extension compile flag changes Other GD extension changes Discovering changes to the Reflection extension Reflection extension usage Learning about Reflection extension improvements Working with other extension gotchas New database extension operating system library requirements Reviewing changes to the ZIP extension Examining PCRE extension changes Working with Intl extension changes Understanding cURL extension changes Reviewing COM extension changes Examining other extension changes Summary Chapter 8: Learning about PHP 8's Deprecated or Removed Functionality Technical requirements Discovering what has been removed from the core Examining functions removed in PHP 8 Discovering other PHP 8 usage changes Examining core deprecations Deprecated usage in parameter order Working with removed functionality in PHP 8 extensions Discovering mbstring extension changes Reworking code that uses Reflection*::export() Discovering other deprecated PHP 8 extension functionality Changes to the XML-RPC extension Changes made to the DOM extension Dealing with deprecated or removed security-related functionality Examining PHP 8 stream-filter changes Dealing with custom error-handling changes Dealing with changes to backtraces PDO error-handling mode default changed Examining the track_errors php.ini setting Summary Section 3: PHP 8 Best Practices Chapter 9: Mastering PHP 8 Best Practices Technical requirements Discovering method signature changes Managing magic method signatures Examining Reflection method signature changes Dealing with PDO extension signature changes Dealing with newly defined static methods Working with the static return type Extending the use of the ::class constant Taking advantage of trailing commas Learning about methods that are no longer required Working with interfaces and traits Discovering new DOM extension interfaces Using new DateTime methods Understanding PHP 8 trait handling refinements Dealing with private methods Controlling anonymous class usage Understanding changes in namespaces Discovering differences in tokenization Using reserved keywords in a namespace Exposing bad namespace naming practices Summary Chapter 10: Improving Performance Technical requirements Working with the JIT compiler Discovering how PHP works without JIT Enabling the JIT compiler Configuring the tracing mode Using the JIT compiler Debugging with the JIT compiler Discovering additional JIT compiler settings Speeding up array handling Working with SplFixedArray in PHP 8 Implementing stable sort Understanding stable sorts Contrasting stable and non-stable sorting Examining the effect of stable sorting on keys Handling illegal sort functions Using weak references to improve efficiency Taking advantage of weak references Reviewing the WeakReference class definition Using weak references Working with WeakMap Implementing a container class using SplObjectStorage Understanding the benefits of WeakMap over SplObjectStorage Summary Chapter 11: Migrating Existing PHP Apps to PHP 8 Technical requirements Understanding development, staging, and production environments Defining an environment Learning how to spot BC breaks before a migration Gaining an overview of BC breaks Creating a BC break scan configuration file Developing a BC break scan class Performing the migration Step 1 – Review the migration guide Step 2 – Make sure the current code works Step 3 – Back up everything Step 4 – Create a version control branch Step 5 – Scan for BC breaks Step 6 – Fix incompatibilities Step 7 – Repeat steps 5 and 6 as needed Step 8 – Commit changes to the repository Step 9 – Test in a simulated virtual environment Step 10 – Return to step 5 if the test is unsuccessful Step 11 – Install PHP 8 on the staging environment Step 12 – Test and clone the staging environment to production Testing and troubleshooting the migration Testing and troubleshooting tools Handling issues with Composer Working with unit tests Summary Chapter 12: Creating PHP 8 Applications Using Asynchronous Programming Technical requirements Understanding the PHP async programming model Developing synchronous programming code Understanding the asynchronous programming model Working with async coroutine support Creating a PHP async application Using the Swoole extension Examining the Swoole extension Installing the Swoole extension Testing the installation Examining a sample I/O-intensive application Using the Swoole extension to improve application performance Using selected PHP frameworks in async mode Working with ReactPHP Implementing PHP async using Amp Using Mezzio with Swoole Working with the parallel extension Learning about PHP 8.1 fibers Discovering the Fiber class Using fibers Examining the effect of fibers on ReactPHP and Swoole Summary Why subscribe? About Packt Other Books You May Enjoy Index