<?php
class P{
public $foo;
}
class C extends P {
public $lol;
public function getFields()
{
var_dump(array_keys(get_class_vars(parent::getClass())));
return array_keys(get_class_vars(__CLASS__));
}
}
$c = new C();
var_dump($c->getFields());
Fatal error: Uncaught Error: Call to undefined method P::getClass() in /in/knr66:12
Stack trace:
#0 /in/knr66(18): C->getFields()
#1 {main}
thrown in /in/knr66 on line 12
Process exited with code 255.
Fatal error: Call to undefined method P::getclass() in /in/knr66 on line 12
Process exited with code 255.
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/knr66 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/knr66 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/knr66 on line 4
Process exited with code 255.