php-src/tests/classes/private_007.phpt

29 lines
384 B
Plaintext
Raw Normal View History

2003-02-06 07:07:24 +08:00
--TEST--
2003-08-09 22:48:47 +08:00
ZE2 A derived class does not know about privates of ancestors
2003-02-06 07:07:24 +08:00
--FILE--
<?php
class Bar {
public static function pub() {
Bar::priv();
}
private static function priv() {
echo "Bar::priv()\n";
}
}
class Foo extends Bar {
2018-10-14 23:23:43 +08:00
public static function priv() {
2003-02-06 07:07:24 +08:00
echo "Foo::priv()\n";
}
}
Foo::pub();
Foo::priv();
echo "Done\n";
?>
--EXPECTF--
Bar::priv()
Foo::priv()
Done