4 * Copyright (c) 2014, Facebook, Inc.
7 * This source code is licensed under the BSD-style license found in the
8 * LICENSE file in the "hack" directory of this source tree. An additional grant
9 * of patent rights can be found in the PATENTS file in the same directory.
13 protected function foo(): string { return 'a'; }
15 class BBB
extends AAA
{
16 protected function foo(): string { return 'b'; }
18 class CCC
extends AAA
{
19 public function bar(): string { return (new BBB())->foo(); }
20 public function baz(): string { return $this->bbb()->foo(); }
21 private function bbb(): AAA
{ return new BBB(); }