<?php
class a {
public static function ii(){
var_dump($this);
}
}
class b extends a {
public function aa(){
$a = new a();
$a->ii();
}
}
$bb = new b();
$bb->aa();
Fatal error: Uncaught Error: Using $this when not in object context in /in/ddand:4
Stack trace:
#0 /in/ddand(10): a::ii()
#1 /in/ddand(15): b->aa()
#2 {main}
thrown in /in/ddand on line 4
Process exited with code 255.
Notice: Undefined variable: this in /in/ddand on line 4
NULL
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: this in /in/ddand on line 4
NULL
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/ddand on line 3
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/ddand on line 3
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/ddand on line 3
Process exited with code 255.