php-src/tests/classes/property_override_protectedStatic_privateStatic.phpt
Nikita Popov 380e705fc2 Use consistent line numbers for early binding errors
Non-early-bound classes report inheritance errors at the first line
of the class, if no better line information is available (we should
really store line numbers for properties at least...) Early bound
classes report it at the last line of the class instead.

Make the error reporting consistent by always reporting at the
first line.
2021-07-28 12:35:20 +02:00

31 lines
536 B
PHP

--TEST--
Redeclare inherited protected static property as private static.
--FILE--
<?php
class A
{
protected static $p = "A::p (static)";
static function showA()
{
echo self::$p . "\n";
}
}
class B extends A
{
private static $p = "B::p (static)";
static function showB()
{
echo self::$p . "\n";
}
}
A::showA();
B::showA();
B::showB();
?>
--EXPECTF--
Fatal error: Access level to B::$p must be protected (as in class A) or weaker in %s on line 11