0

Small but strange, why php allowing me to access the non-static method as static. As you can see in my example I just created a simple class and create non-static method and when trying to access the same with scope resolution character, it easily accessible:

class test{

    public function myFunction(){
        echo "This is test function";
    }
}

test::myFunction();

can anyone tell me where I am wrong in this:

Output

enter image description here

Rahul Sharma
  • 622
  • 7
  • 25

0 Answers0