Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find whether the type of a variable is integer
<?php is_int(mixed $value): bool
<?php                 switch (true) {

                    case null === $v:

                    case \is_bool($v):

                    case \is_int($v):

                    case \is_float($v):

                        continue 2;

                    case \is_string($v):
<?php                     $style = 'index';


                case Cursor::HASH_ASSOC:

                    if (\is_int($key)) {

                        $this->line .= $this->style($style, $key).' => ';

                    } else {

                        $this->line .= $bin.'"'.$this->style($style, $key).'" => ';
<?php     public function testDumpPeriod($start, $interval, $end, $options, $expected)

    {

        $p = new \DatePeriod(new \DateTime($start), new \DateInterval($interval), \is_int($end) ? $end : new \DateTime($end), $options);



        $xDump = <<<EODUMP

DatePeriod {
<?php     public function testCastPeriod($start, $interval, $end, $options, $xPeriod, $xDates)

    {

        $p = new \DatePeriod(new \DateTime($start, new \DateTimeZone('UTC')), new \DateInterval($interval), \is_int($end) ? $end : new \DateTime($end, new \DateTimeZone('UTC')), $options);

        $stub = new Stub();



        $cast = DateCaster::castPeriod($p, [], $stub, false, 0);