TOP
GOGO開學趣,參考書應有盡有
PHP Type System Explained: How Modern Type Declarations Will Make You a Better PHP Developer
滿額折

PHP Type System Explained: How Modern Type Declarations Will Make You a Better PHP Developer

商品資訊

定價
:NT$ 672 元
無庫存,下單後進貨(到貨天數約30-45天)
下單可得紅利積點:20 點
商品簡介

商品簡介

You will learn to:

  • Grasp the Fundamentals: Understand the core concepts of type systems (Static vs. Dynamic, Strong vs. Weak) and see where PHP fits in, appreciating its journey from a loosely-typed language to a modern, stricter one.
  • Avoid Historical Pitfalls: Master the dangers of automatic type juggling and loose comparisons (==). You'll learn why 0 == "a" is true in PHP and how to permanently avoid such bugs using strict comparisons (===) and defensive type-checking functions.
  • Master the PHP 7 Revolution: Implement the game-changing features introduced in PHP 7. This includes declaring scalar parameter types (int, string, bool, float), specifying function return types, and using nullable types (?string) to handle optional values gracefully.
  • Take Full Control with Strict Mode: Understand the critical difference between PHP's default coercive type mode and strict mode. You'll learn how, when, and why to use declare(strict_types=1); to enforce exact type matches and prevent unintended type conversions.
  • Leverage Modern PHP 8+ Features: Wield the powerful and expressive types introduced in PHP 8 and beyond.
    • Union Types: Define parameters or properties that can accept multiple distinct types, like intfloat.
    • Intersection Types: Require objects to satisfy multiple contracts simultaneously, such as LoggerInterface&FormatterInterface.
    • readonly Properties: Create immutable Value Objects and Data Transfer Objects (DTOs) whose properties cannot be changed after initialization.
    • mixed, never, and static: Use mixed to explicitly allow any type, never to signify functions that always exit or throw, and static for more powerful factory patterns.
  • Improve Code Quality and Maintainability: Discover how a well-typed codebase leads to fewer bugs, better self-documentation, and superior IDE support with more accurate autocompletion and error detection.
  • Harness Static Analysis: Learn how modern types enable powerful static analysis tools like PHPStan and Psalm to find bugs in your code before it ever runs, dramatically increasing code reliability.
  • Apply Types in Real-World Scenarios: Move beyond theory to practical application. You will learn to design robust services, build clear APIs, and implement strategies for gradually introducing strong typing into existing legacy projects without causing disruption.
  • Look to the Future: Get a glimpse of what's next for PHP's type system, including highly anticipated features like Generics and typed arrays, ensuring your skills remain current.

購物須知

外文書商品之書封,為出版社提供之樣本。實際出貨商品,以出版社所提供之現有版本為主。部份書籍,因出版社供應狀況特殊,匯率將依實際狀況做調整。

無庫存之商品,在您完成訂單程序之後,將以空運的方式為你下單調貨。為了縮短等待的時間,建議您將外文書與其他商品分開下單,以獲得最快的取貨速度,平均調貨時間為1~2個月。

為了保護您的權益,「三民網路書店」提供會員七日商品鑑賞期(收到商品為起始日)。

若要辦理退貨,請在商品鑑賞期內寄回,且商品必須是全新狀態與完整包裝(商品、附件、發票、隨貨贈品等)否則恕不接受退貨。

定價:100 672
無庫存,下單後進貨
(到貨天數約30-45天)

暢銷榜

客服中心

收藏

會員專區