Run the Code directly. {Code...} Why? The two files are in the same folder and directory. It should be fine if they are not included, and the inheritance commonly used in the framework is not include. Run the Code directly.
namespace 'Test';class A{ }
Namespace 'test'; // if you run B directly, an error is returned, indicating that AAinclude 'a. php' cannot be found. // after adding include, class B extends A {} can be created {}
Why? The two files are in the same folder and directory. It should be fine if they are not included, and the inheritance commonly used in the framework is not include.
Reply content:
Run the Code directly.
namespace 'Test';class A{ }
Namespace 'test'; // if you run B directly, an error is returned, indicating that AAinclude 'a. php' cannot be found. // after adding include, class B extends A {} can be created {}
Why? The two files are in the same folder and directory. It should be fine if they are not included, and the inheritance commonly used in the framework is not include.
That's because the framework has already registered its ownautoloadSo when you needAIf the current file does not containAThis class triggersautoloadMechanism, throughautoloadSetAFile corresponding to the classincludeCome in.
I want to learn more about the basics, but how can I use it without include? The framework must also be included, but it is encapsulated.
If you do not use include, you will call autoload to search for Class A in the default file location. Obviously, the current folder is not in the default location?