0

I just recently discovered this strange behavior in my project.

I have a method that I accidentally defined as just a function (it's supposed to be public static), and then I called this method statically – and it still worked! Why is this?

class C {
   function n() {
      ...
   }
}

$y = C::n();  // This works, method is performed as intended, and without errors

By the way, I am using version 5.4.

4

0 回答 0