<?php
class Magic {
public function delete() {
echo "OMG CALLED!!".PHP_EOL;
}
};
class EmptyClass extends Magic {
};
class MethodTest extends Magic {
public function omg() {
EmptyClass::delete();
}
};
$obj = new MethodTest;
$obj->omg();
?>
Fatal error: Uncaught Error: Non-static method Magic::delete() cannot be called statically in /in/lsngY:18
Stack trace:
#0 /in/lsngY(25): MethodTest->omg()
#1 {main}
thrown in /in/lsngY on line 18
Process exited with code 255.
Deprecated: Non-static method Magic::delete() should not be called statically, assuming $this from incompatible context in /in/lsngY on line 18
OMG CALLED!!
Strict Standards: Non-static method Magic::delete() should not be called statically, assuming $this from incompatible context in /in/lsngY on line 18
OMG CALLED!!
Output for 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/lsngY on line 5
OMG CALLED!!PHP_EOL
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/lsngY on line 4
Process exited with code 255.
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/lsngY on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/lsngY on line 4
Process exited with code 255.