mirror of
https://github.com/php/php-src.git
synced 2024-11-26 19:33:55 +08:00
380e705fc2
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.
32 lines
506 B
PHP
32 lines
506 B
PHP
--TEST--
|
|
Redeclare inherited protected static property as private.
|
|
--FILE--
|
|
<?php
|
|
class A
|
|
{
|
|
protected static $p = "A::p (static)";
|
|
static function showA()
|
|
{
|
|
echo self::$p . "\n";
|
|
}
|
|
}
|
|
|
|
class B extends A
|
|
{
|
|
private $p = "B::p";
|
|
function showB()
|
|
{
|
|
echo $this->p . "\n";
|
|
}
|
|
}
|
|
|
|
|
|
A::showA();
|
|
|
|
$b = new B;
|
|
$b->showA();
|
|
$b->showB();
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Cannot redeclare static A::$p as non static B::$p in %s on line 11
|