||New Reviews| |Software Methodologies| |Popular Science| |AI/Machine Learning| |Programming| |Java| |Linux/Open Source| |XML| |Software Tools| |Other| |Web| |Tutorials| |All By Date| |All By Title| |Resources| |About||
Keywords: PHP, Hack, programming languages, web development
Title: Modern PHP
Author: Josh Lockhart
Level: Introductory - some previous PHP assumed
Verdict: An interesting, fast read, but could have done with more emphasis on the language side of things
For those of us who have not looked at PHP for some time the changes in the language are quite significant, and are matched by a maturation in the broader platform and practices that have been adopted by the PHP community. 'Modern PHP' is a book that brings the reader up to speed on these changes - going far beyond purely language constructs to look at standards, development environments, best practices, testing, deployment, profiling, alternative virtual machines and more.
The starting point though is the language itself. The first quick chapter gives a whistle-stop historical run through and then it's on to the second chapter devoted to the language changes. Topics include name spaces, interfaces, traits, generators and closures. This is where you get to see that PHP has indeed kept up with other modern languages - though in a later section of the book you learn about the Hack language which takes PHP further towards languages such as Java and C#.
Part two of the book is entitled Good Practices - though in point of fact the first two chapters of this section - which cover components and frameworks - really ought to be considered with the language changes as they fundamentally change the way you program in PHP. It's chapter five, which is actually entitle 'Good Practices' that you really get to deal with good practices? This means things like handling user input, passwords and hashing, multi-byte strings, database access through PDO, dates and times and so on. In other words some of the core issues that nearly every data driven PHP application has to deal with.
Part three moves on the platform side of things. This includes hosting, provisioning, tuning, deploying, testing and profiling. The PHP virtual machine and Hack also get a chapter, as does the topic of supporting the PHP community. While interesting, this section of the book is more likely to appeal to the DevOps out there than the developer who never has to poke around at the server level. But don't think this is uninteresting; it's just that for a pure dev it's likely that the earlier parts of the book are going to be the more interesting.
Overall this is an interesting read with a wide range of content. It could have done with more emphasis on the language aspects and more in the section on good practices. The additional material on picking a hosting plan and the ins and outs of different types of server platform really could have gone in an appendix as it's unlikely that most developers are that interested or have that much say in the choice of underlying platform. Still, overall this is a good choice for a reader looking for a PHP update or a quick refresher course.