I'm not sure why he would not throw a warning, or at least an error. However, there are some significant differences in statics and instance. The static method cannot use class variables that are not static. This is easy to verify by adding a public / private variable that is non-stationary and tries to map it to staticFunc , which will staticFunc error.
I think that the main goal is to understand the differences between them and how to use them correctly. As to why PHP, at least, does not raise Notification, I donβt know, perhaps this is due to its laid-back nature. I am interested in the answer, who has more knowledge that he can give, this is just a little additional information.
I tested it with a full error message, and, of course, it really doesn't throw any notifications or warnings.
UPDATE
By doing some testing, it seems that when you call a non-stationary static function as a static function, you still cannot use private / public variables. Which, for ordinary functions, is likely to disable them. Which may be why the error or notification was never thrown. However, it would be nice if he was throwing something, since using an unmarked static function in this way is certainly not very good.
source share