If I have an index file with:
Code: Select all
date_default_timezone_set('GMT');
error_reporting(E_ALL | E_STRICT);
abstract class A {
abstract public static function YesIReallyMeanAbstractStatic();
}
class B extends A {
public static function YesIReallyMeanAbstractStatic() {
}
}However if I have:
Code: Select all
date_default_timezone_set('GMT');
error_reporting(E_ALL | E_STRICT);
require('class_a_in_a_different_file.php'); // Or use __autoload() to do the same.
class B extends A {
public static function YesIReallyMeanAbstractStatic() {
}
}"Static function A::YesIReallyMeanAbstractStatic() should not be abstract"
I know abstract statics are debatable...
but it makes no sense to me for it to be allowed in the first example but disallowed in other.
So I was wondering if this is a bug? Or is there something else going on here?
I assume the parser is evaluating the included file and then throwing the error which doesn't happen if both classes are in the same file as they can then be evaluated altogether.