mirror of
https://github.com/php/php-src.git
synced 2024-12-16 21:37:49 +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.
33 lines
518 B
PHP
33 lines
518 B
PHP
--TEST--
|
|
Redeclare inherited protected property as public static.
|
|
--FILE--
|
|
<?php
|
|
class A
|
|
{
|
|
protected $p = "A::p";
|
|
function showA()
|
|
{
|
|
echo $this->p . "\n";
|
|
}
|
|
}
|
|
|
|
class B extends A
|
|
{
|
|
public static $p = "B::p (static)";
|
|
static function showB()
|
|
{
|
|
echo self::$p . "\n";
|
|
}
|
|
}
|
|
|
|
|
|
$a = new A;
|
|
$a->showA();
|
|
|
|
$b = new B;
|
|
$b->showA();
|
|
B::showB();
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Cannot redeclare non static A::$p as static B::$p in %s on line 11
|