Some people really like PHP and some really dislike it. Most developers that really like PHP do not have experience with languages such as C, C++ and Java (there are many others). PHP supports good development but it also makes it easy to make programs difficult to understand.
The include statement in PHP is very different from the include statement in C and C++.
Using the simple sample provided here, it is very difficult to explain why an include statement in PHP might be a problem. If the sample were more complicated with nested levels of includes and with many variables used without an easy way not know what is where and why then it can become what some programmers call spaghetti. I was a programmer back in the days when gotos were common. It is difficult to explain why a goto is bad when you have just one. But if you are a maintenance programmer that must fix or modify a program written by someone else and modified many times by many programmers then you will learn what a mess they can make.
So it partially depends who the program is written for. If it is your program and no one else will touch it then you can do things the way you want to. If you are developing the program for a client then it is better to keep things as clean as possible. You should make the software robust enough that further modifications can be made with minimal additional complications. So even if you are programming for yourself it is better to develop skills that are good for others too.
There is a term called Side effect that is relevant here. Side effects should be avoided and when they exist they should be documented. Putting code in a function tends to limit the scope of variables and therefore reduces side effects.