In practice, write a simple PHP file and include a js file. After the file is executed, no error or warning information is reported. At the same time, the content of the file containing js is printed. Therefore, it is concluded that the include object can be of any type.
Now let's look back at the include official document, which includes the following: "When a file is contained, the syntax parser disconnects from the PHP mode at the beginning of the target file and enters the HTML mode, restore to the end of the file. For this reason, any code in the target file that needs to be executed as PHP code must be included in the valid PHP start and end tags ." Note that the "HTML mode, PHP code must be included in a valid PHP tag" is mentioned in this document, and you can carefully understand its meaning. In fact, it implicitly illustrates that include can be any type of file.
In addition, after 4.3.0, The include target file can also be a url, provided that allow_url_include must be set to on in the configuration.