is_scalar
laravel/framework
Supported Versions: PHP 4 >= 4.0.5, PHP 5, PHP 7, PHP 8
Finds whether a variable is a scalar
is_scalar
(
mixed $value
):
bool
{
$actualValue
=
$this
->
getValue
(
$attribute
);
if (
is_scalar
(
$actualValue
) ||
is_null
(
$actualValue
)) {
$message
=
str_replace
(
':input'
,
$this
->
getDisplayableValue
(
$attribute
,
$actualValue
),
$message
);
}
src/Illuminate/Validation/Concerns/FormatsMessages.php
return
false
;
}
if (!
is_scalar
(
$value
) && !
is_null
(
$value
) && !
method_exists
(
$value
,
'__toString'
)) {
return
false
;
}
src/Illuminate/Validation/Concerns/ValidatesAttributes.php