public function __construct($value = null, $type = self::TYPE_AUTO, $outputMode = self::OUTPUT_MULTIPLE_LINE, $constants = null)
{
// strict check is important here if $type = AUTO
if ($value !== null) {
$this->setValue($value);
}
if ($type !== self::TYPE_AUTO) {
$this->setType($type);
}
if ($outputMode !== self::OUTPUT_MULTIPLE_LINE) {
$this->setOutputMode($outputMode);
}
if ($constants === null) {
$constants = new SplArrayObject();
} elseif (!($constants instanceof SplArrayObject || $constants instanceof StdlibArrayObject)) {
throw new InvalidArgumentException('$constants must be an instance of ArrayObject or Zend\\Stdlib\\ArrayObject');
}
$this->constants = $constants;
}