<?php
class Class1 {
function foo(){ }
}
class Class2 {
function bar(){
Class1::foo();
}
}
$class2 = new Class2();
$class2->bar();
echo "And the error message";
?>
Fatal error: Uncaught Error: Non-static method Class1::foo() cannot be called statically in /in/moFWk:11
Stack trace:
#0 /in/moFWk(18): Class2->bar()
#1 {main}
thrown in /in/moFWk on line 11
Process exited with code 255.
Deprecated: Non-static method Class1::foo() should not be called statically, assuming $this from incompatible context in /in/moFWk on line 11
And the error message
Strict Standards: Non-static method Class1::foo() should not be called statically, assuming $this from incompatible context in /in/moFWk on line 11
And the error message