<?php
class T {
public function x(){
return true;
}
}
var_dump(T::x());
class X {
public function x(){
return true;
}
}
var_dump(X::x());
This code results in:
bool(true)
PHP Fatal error: Non-static method X::x() cannot be called statically in test.php on line 16
Why does T::x() works (when it should fail) and X::x() fails (as it should)?
$x = T::x();is successful?!