SplEnum::getConstList

(PECL spl_types >= 0.1.0)
Returns all consts (possible values) as an array.
public array SplEnum::getConstList ([ bool $include_default = false ] )
Parameters:
include_default

Whether to include __default property.

Returns:

This function is currently not documented; only its argument list is available.

Examples:
SplEnum::getConstList() example
<?php
$bool = new SplBool;
var_dump($bool->getConstList(true));
?>

The above example will output:

array(3) {
  ["__default"]=>
  bool(false)
  ["false"]=>
  bool(false)
  ["true"]=>
  bool(true)
}
doc_php
2016-02-24 16:06:46
Comments
Leave a Comment

Please login to continue.