is_scalar

Supported Versions: PHP 4 >= 4.0.5, PHP 5, PHP 7, PHP 8
Finds whether a variable is a scalar
<?php is_scalar(mixed $value): bool
<?php     {

        $actualValue = $this->getValue($attribute);



        if (is_scalar($actualValue) || is_null($actualValue)) {

            $message = str_replace(':input', $this->getDisplayableValue($attribute, $actualValue), $message);

        }
<?php             return false;

        }



        if (! is_scalar($value) && ! method_exists($value, '__toString')) {

            return false;

        }
<?php         array $possibleTypes,

        ?Throwable $previous = null

    ) {

        if (is_scalar($value) || $value === null) {

            return new self(sprintf(

                'Could not convert PHP value %s to type %s. Expected one of the following types: %s',

                var_export($value, true),
<?php         $values = [];

        foreach ($args as $k => $v) {

            $values[$k] = !is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v;

        }

        if (null === $params) {

            parent::__construct($values, false);
<?php         }



        if ('const' === $style && isset($attr['value'])) {

            $style .= sprintf(' title="%s"', esc(is_scalar($attr['value']) ? $attr['value'] : json_encode($attr['value'])));

        } elseif ('public' === $style) {

            $style .= sprintf(' title="%s"', empty($attr['dynamic']) ? 'Public property' : 'Runtime added dynamic property');

        } elseif ('str' === $style && 1 < $attr['length']) {