mirror of
https://github.com/php/php-src.git
synced 2024-12-04 23:34:25 +08:00
34 lines
510 B
PHP
34 lines
510 B
PHP
--TEST--
|
|
Redeclare inherited public static property as private.
|
|
--FILE--
|
|
<?php
|
|
class A
|
|
{
|
|
public 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 18
|
|
|