Typed PHP

Typed PHP

Author: Christopher Pitt

 Why Write This Book  The purpose of this book is to simplify how we work with strings, numbers, arrays, etc. They’re called  Scalar types,  because PHP treats them differently to objects. They have no properties or methods.  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.  I’m all for getting stuff done, and to that end I have used PHP for many years. It’s always bugged me how procedural PHP is, in an ecosystem of OOP libraries and frameworks. So I decided to take a deeper look at building a stronger type system on top of PHP.  In this book, we’ll look at how to use  standard  PHP libraries. We look at user-land libraries. We look at using extensions and cross-compilers. All this will contribute toward creating a set of reusable tools that unify and ease the scalar types of PHP.  

Download