mirror of
https://github.com/php/php-src.git
synced 2024-11-25 02:44:58 +08:00
34 lines
527 B
Plaintext
34 lines
527 B
Plaintext
|
--TEST--
|
||
|
Redeclare inherited public property as protected static.
|
||
|
--FILE--
|
||
|
<?php
|
||
|
class A
|
||
|
{
|
||
|
public $p = "A::p";
|
||
|
function showA()
|
||
|
{
|
||
|
echo $this->p . "\n";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class B extends A
|
||
|
{
|
||
|
protected 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 18
|