Basically, the require and the include commands in PHP do the same thing. Both of them allows our code to use code written in another file by including it into the file we code as if it was part of it. The only difference takes place when encountering a problem. When using require the problem will crash the script and we will get a server error message. When using include the problem won’t stop running those parts of our script that can still run even though the problem that happens. The following video clip uses a short code sample for explaining this difference.
The Visitor Design Pattern
The visitor design pattern allows us to add operations to objects that already exist without modifying their classes and without extending them.