Skip to Main Content
PHP Cookbook
book

PHP Cookbook

by Eric A. Mann
May 2023
Intermediate to advanced content levelIntermediate to advanced
431 pages
8h 55m
English
O'Reilly Media, Inc.
Content preview from PHP Cookbook

Preface

Nearly every developer who builds modern web applications has an opinion on PHP. Some love the language. Some loathe the language. Most are familiar with its impact and applications written in the language. This is because PHP powers over 75% of websites for which the language in which they are written is known. Given the sprawling size of the internet, that’s a lot of PHP code in the wild.1

Admittedly, not all PHP code is good code. Anyone who has written PHP code has seen the good, the bad, and the ugly presented by the language. It’s a remarkable easy language to work with, which is cause for both the sheer power behind its market dominance and for the missteps made by many engineers writing questionable code.

Unlike fully compiled languages that enforce strict typing and memory management, PHP is an interpreted language that is incredibly forgiving of programming mistakes. In many cases, even a grievous programming error will result in a warning while PHP continues to happily execute the program regardless. This is great for developers learning a new language, as an innocent error won’t necessarily crash the application. But this forgiving nature is a double-edged sword of sorts. As even “bad code” will run, many developers publish that code, which is then easily reused by unsuspecting beginners.

This book aims to defend against the reuse of bad code by helping you understand how to avoid mistakes made by those who came before. It also aims to establish patterns and ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Clean Code in PHP

Clean Code in PHP

Carsten Windler, Alexandre Daubois
Go Cookbook

Go Cookbook

Sau Sheong Chang

Publisher Resources

ISBN: 9781098121310Errata Page