Slide 26
Slide 26 text
Collections
• Vector, Map, Set, Pair
• Immutable versions: ImmVector, ImmMap, ImmSet
• Can be initialised using literal syntax
$vec = Vector {'foo', 'foo', 'bar'}; // integer keys!
$map = Map {42 => 'foo', 73 => 'bar', 144 => 'baz'}; // ordered dictionary!
$set = Set {'php', 'hack', 'hhvm'}; // unordered unique values!
$par = Pair {'guid', 'ABC123'}; // only two pieces of data!
• Type annotation
function getTags(): Set {!
return Set { "php", "hack", "hhvm" };!
}