2 // Copyright 2004-present Facebook. All Rights Reserved.
6 // These shape indices are
7 // - not equal as far as static type-checking is concerned
8 // - equal for runtime indexing :-(
10 const string OfB
= "whatevs";
11 const string OfC
= "whatevs";
12 public function Foo():void
{ echo 'Foo'; }
14 type ShapeTy
= shape(C
::OfB
=> B
, C
::OfC
=> C
);
15 function DoIt(ShapeTy
$x):void
{
21 function BreakIt():void
{
22 // Sensitive to order: this will not fail at runtime
23 // $s = shape(C::OfB => new B(), C::OfC => new C());
25 $s = shape(C
::OfC
=> new C(), C
::OfB
=> new B());