HH\Pair::items

Returns an Iterable view of the current Pair.

Description

public function items(): Iterable<mixed>

Returns an Iterable view of the current Pair.

The Iterable returned is one that produces the values from the current Pair.

Return Values

Examples

<?hh

namespace Hack\UserDocumentation\API\Examples\Pair\Items;

$p = Pair {'foo', -1.5};

// Get an Iterable view of the Pair
$iterable = $p->items();

// Print both values in the Iterable
foreach ($iterable as $value) {
  echo $value."\n";
}
Output
foo
-1.5