xref: /PHP-8.0/tests/classes/private_007b.phpt (revision f8d79582)
1--TEST--
2ZE2 A derived class does not know about privates of ancestors
3--FILE--
4<?php
5
6class Bar {
7    public function pub() {
8        $this->priv();
9    }
10    private function priv()	{
11        echo "Bar::priv()\n";
12    }
13}
14class Foo extends Bar {
15    public function priv()	{
16        echo "Foo::priv()\n";
17    }
18}
19
20$obj = new Foo();
21$obj->pub();
22$obj->priv();
23
24echo "Done\n";
25?>
26--EXPECT--
27Bar::priv()
28Foo::priv()
29Done
30