Extracted from Pike v7.8 release 866 at 2016-11-06.
pike.ida.liu.se
[Top]
Array

Method Array.arrayify()


Method arrayify

array arrayify(void|array|mixed x)

Description

Make an array of the argument, if it isn't already. A zero_type argument gives the empty array. This is useful when something is either an array or a basic datatype, for instance in headers from the MIME module or Protocols.HTTP.Server.

Parameter x

Result depends of the argument type:

arrayp(x)

arrayify(x) => x

zero_type(x)

arrayify(x) => ({})

otherwise

arrayify(x) => ({ x })