PHP Objects, Patterns, and Practice

Category: Programming
Author: Matt Zandstra
All Stack Overflow 8


by Martin Meredith   2017-08-20

I'd personally reccomend PHP Objects, Patterns and Practice

by anonymous   2017-08-20

Disk is a slowest part of the server, so in this case variant "all functions in 1 file" will give you little more performance, theoretically.

But I don't recommend you to create "functions.php", better way is OOP. Create classes (objects) with methods, use autoloaders and PSR-0 standard and you will forget about "include" and "require" at all.

by anonymous   2017-08-20


  1. While exists at least 1 way, where you can build class without magic methods - use that way, avoid magic methods if you can.
  2. If you can't describe class in interface - class was designed wrong.
  3. Registry is bad pattern. If you need registry - something is wrong in your design.

Good book about patterns and design