(PHP 7, PHP 8)
The SplInt class is used to enforce strong typing of the integer type.
SplInt extends SplType {
/* Constants */
public const integer __default = 0;
/* Methods */
public function __construct ([ int $initial_value = 0 ])
final public function &__invoke(): int
}
SplInt::__default
<?php
$int = new SplInt(94);
echo $int . PHP_EOL;
The above example will output:
94
- SplType::__construct — Creates a new value of some type
- SplInt::__invoke — Invoke object like a method