相關主題
商品描述
Discover how stronger types mean cleaner, more efficient, and optimized PHP applications. This unique book looks at typed PHP: PHP types, strings, regular expressions, and more from PHP 7 as found in standard PHP libraries, user libraries, extensions, and cross-compilers. You'll see how to create a set of reusable tools that unify and ease the scalar types of PHP.
PHP has a rich history and a dominant place on the web. It has achieved much despite language inconsistencies and difficulties. Bjarne Stroustrup once said: "There are only two kinds of languages: the ones people complain about and the ones nobody uses".
PHP is one of those languages that everybody uses, yet that's often seen as a good reason to ignore the bad parts and just get stuff done. We're all for getting stuff done, and to that end, the author has used Plain Ol' PHP for many years. It's always bugged him how procedural PHP is, in an ecosystem of OOP libraries and frameworks. So he decided to take a deeper look at building a stronger type system on top of PHP. That's the goal of this book.
- Discover the fundamentals of PHP strings, regex, underscores, native function inconsistencies, and more
- Examine the structure of PHP types including boxing, regex, namespace functions, composer autoload, null problem, optional values, and more
- Work with extensions like vagrant + phansible, provisioning, vagrant commands, SPL types, scalar objects, zephir, and more
- Design using scalar, SPL, zephir, structure types, resolving types, chaining, combining number types, PHPUnit, packaging, and more
- Plan for the future using a case study example
商品描述(中文翻譯)
發現更強的類型如何使 PHP 應用程式更乾淨、更高效且經過優化。本書獨特地探討了有類型的 PHP:PHP 類型、字串、正則表達式,以及 PHP 7 中的其他內容,這些內容來自標準 PHP 函式庫、用戶函式庫、擴展和交叉編譯器。您將看到如何創建一組可重用的工具,以統一和簡化 PHP 的標量類型。
PHP 擁有豐富的歷史並在網路上佔據主導地位。儘管語言不一致和困難,它仍然取得了許多成就。Bjarne Stroustrup 曾經說過:「只有兩種語言:人們抱怨的語言和沒有人使用的語言。」
PHP 是所有人都在使用的語言之一,但這常常被視為忽略其缺點並完成工作的好理由。我們都支持完成工作,為此,作者多年前就一直使用 Plain Ol' PHP。他一直對於在 OOP 函式庫和框架的生態系統中,程序式 PHP 的特性感到困擾。因此,他決定深入研究在 PHP 上構建更強類型系統的可能性。這就是本書的目標。
您將學到什麼
- 探索 PHP 字串、正則表達式、底線、原生函式不一致性等的基本原理
- 檢視 PHP 類型的結構,包括裝箱、正則表達式、命名空間函式、Composer 自動加載、空值問題、可選值等
- 使用 vagrant + phansible、配置、vagrant 命令、SPL 類型、標量物件、zephir 等擴展進行工作
- 設計使用標量、SPL、zephir、結構類型、解析類型、鏈接、組合數字類型、PHPUnit、打包等
- 使用案例研究範例為未來做規劃
這本書適合誰
這本書適合有經驗的網頁開發者和 PHP 程式設計師。