3 * Copyright (c) 2014, Facebook, Inc.
6 * This source code is licensed under the BSD-style license found in the
7 * LICENSE file in the "hack" directory of this source tree. An additional grant
8 * of patent rights can be found in the PATENTS file in the same directory.
13 public function setA(): this
{ return $this; }
16 class Child1
extends Base
{}
17 class Child2
extends Base
{}
18 class Child3
extends Base
{}
19 class Child4
extends Base
{}
21 function foo(int $x): Base
{
24 $thing = new Child1();
27 $thing = new Child2();
30 $thing = new Child3();
33 $thing = new Child4();
36 return $thing->setA()->setA()->setA()->setA();