Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Znav
nextPHP Mapping for Dictionaries
prevPHP Mapping for Structures

A Slice sequence maps to a native PHP indexed array. The first element of the Slice sequence is contained at index 0 (zero) of the PHP array, followed by the remaining elements in ascending index order.

Consider this example:

Wiki Markup
{zcode:slice}
sequence<Fruit> FruitPlatter;
{zcode}

You can create an instance of FruitPlatter as shown below:

Wiki Markup
{zcode:php}
// Make a small platter with one Apple and one Orange
//
$platter = array(Fruit::Apple, Fruit::Orange);
{zcode}

The Ice run time validates the elements of an array to ensure that they are compatible with the declared type and raises InvalidArgumentException if an incompatible type is encountered.

Ztop
See Also
Zret
Znav
nextPHP Mapping for Dictionaries
prevPHP Mapping for Structures