class SplString extends SplType (View source)

The SplString class is used to enforce strong typing of the string type.

Constants

__default

Methods

__construct(mixed $initial_value = self::__default, bool $strict = true)

Creates a new value of some type

from  SplType

Details

__construct(mixed $initial_value = self::__default, bool $strict = true)

Creates a new value of some type

Parameters

mixed $initial_value
bool $strict

If set to true then will throw UnexpectedValueException if value of other type will be assigned. True by default