is_object
symfony/var-dumper
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Finds whether a variable is an object
is_object
(
mixed $value
):
bool
if (
null
!==
$callable
) {
if (
$callable
instanceof
\Closure
) {
$r
= new
\ReflectionFunction
(
$callable
);
} elseif (
\is_object
(
$callable
)) {
$r
= [
$callable
,
'__invoke'
];
} elseif (
\is_array
(
$callable
)) {
$r
=
$callable
;
Caster/ClassStub.php
public static function
wrapCallable
(
$callable
)
{
if (
\is_object
(
$callable
) || !
\is_callable
(
$callable
)) {
return
$callable
;
}
Caster/ClassStub.php
if (!(
$filter
&
Caster
::
EXCLUDE_VERBOSE
) &&
$v
=
$c
->
getStaticVariables
()) {
foreach (
$v
as
$k
=> &
$v
) {
if (
\is_object
(
$v
)) {
$a
[
$prefix
.
'use'
][
'$'
.
$k
] = new
CutStub
(
$v
);
} else {
$a
[
$prefix
.
'use'
][
'$'
.
$k
] = &
$v
;
Caster/ReflectionCaster.php
$signature
.=
10
>
\strlen
(
$v
) && !
str_contains
(
$v
,
'\\'
) ?
"'
{
$v
}
'"
:
"'…"
.
\strlen
(
$v
).
"'"
;
} elseif (
\is_bool
(
$v
)) {
$signature
.=
$v
?
'true'
:
'false'
;
} elseif (
\is_object
(
$v
)) {
$signature
.=
'new '
.
substr
(
strrchr
(
'\\'
.
get_debug_type
(
$v
),
'\\'
),
1
);
} else {
$signature
.=
$v
;
Caster/ReflectionCaster.php
}
break;
case
\is_object
(
$v
):
if (empty(
$objRefs
[
$h
=
spl_object_id
(
$v
)])) {
$stub
= new
Stub
();
$stub
->
type
=
Stub
::
TYPE_OBJECT
;
Cloner/VarCloner.php