SPLINT(3) 1 SPLINT(3)
The SplInt class
INTRODUCTION
The SplInt class is used to enforce strong typing of the integer type.
CLASS SYNOPSIS
SplInt
SplIntextends
SplType
Constants
o const integer$SplInt::__default0
Inherited methods
o
SplType::__construct ([mixed $initial_value], [bool $strict])
PREDEFINED CONSTANTS
o SplInt::__default -
EXAMPLES
Example #1
SplInt usage example
<?php
$int = new SplInt(94);
try {
$int = 'Try to cast a string value for fun';
} catch (UnexpectedValueException $uve) {
echo $uve->getMessage() . PHP_EOL;
}
echo $int . PHP_EOL;
?>
The above example will output:
Value not an integer
94
PHP Documentation Group SPLINT(3)