Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Finds whether a variable is an object
<?php is_object(mixed $value): bool
<?php     public function getPolicyFor($class)

    {

        if (is_object($class)) {

            $class = get_class($class);

        }
<?php     public function queue($event)

    {

        if ($event instanceof ShouldBroadcastNow ||

            (is_object($event) &&

             method_exists($event, 'shouldBroadcastNow') &&

             $event->shouldBroadcastNow())) {

            return $this->app->make(BusDispatcherContract::class)->dispatchNow(new BroadcastEvent(clone $event));
<?php             'The expected chain can not be empty.'

        );



        if (collect($expectedChain)->contains(fn ($job) => is_object($job))) {

            $expectedChain = collect($expectedChain)->map(fn ($job) => serialize($job))->all();

        } else {

            $chain = collect($this->chained)->map(fn ($job) => get_class(unserialize($job)))->all();
<?php             foreach ($keys as $key) {

                if (Arr::accessible($item) && Arr::exists($item, $key)) {

                    $result[$key] = $item[$key];

                } elseif (is_object($item) && isset($item->{$key})) {

                    $result[$key] = $item->{$key};

                }

            }
<?php             } else {

                $itemKey = data_get($item, $key);



                if (is_object($itemKey) && method_exists($itemKey, '__toString')) {

                    $itemKey = (string) $itemKey;

                }
<?php         foreach ($this->items as $key => $item) {

            $resolvedKey = $keyBy($item, $key);



            if (is_object($resolvedKey)) {

                $resolvedKey = (string) $resolvedKey;

            }
<?php         $first = $this->first();



        if (is_array($first) || (is_object($first) && ! $first instanceof Stringable)) {

            return implode($glue ?? '', $this->pluck($value)->all());

        }
<?php             if (Arr::accessible($target) && Arr::exists($target, $segment)) {

                $target = $target[$segment];

            } elseif (is_object($target) && isset($target->{$segment})) {

                $target = $target->{$segment};

            } else {

                return value($default);
<?php             } elseif ($overwrite || ! Arr::exists($target, $segment)) {

                $target[$segment] = $value;

            }

        } elseif (is_object($target)) {

            if ($segments) {

                if (! isset($target->{$segment})) {

                    $target->{$segment} = [];
<?php             } else {

                Arr::forget($target, $segment);

            }

        } elseif (is_object($target)) {

            if ($segments && isset($target->{$segment})) {

                data_forget($target->{$segment}, $segments);

            } elseif (isset($target->{$segment})) {
<?php             foreach ($this as $key => $item) {

                $resolvedKey = $keyBy($item, $key);



                if (is_object($resolvedKey)) {

                    $resolvedKey = (string) $resolvedKey;

                }
<?php                 } else {

                    $itemKey = data_get($item, $key);



                    if (is_object($itemKey) && method_exists($itemKey, '__toString')) {

                        $itemKey = (string) $itemKey;

                    }
<?php                     foreach ($keys as $key) {

                        if (Arr::accessible($item) && Arr::exists($item, $key)) {

                            $result[$key] = $item[$key];

                        } elseif (is_object($item) && isset($item->{$key})) {

                            $result[$key] = $item->{$key};

                        }

                    }
<?php             $retrieved = data_get($item, $key);



            $strings = array_filter([$retrieved, $value], function ($value) {

                return is_string($value) || (is_object($value) && method_exists($value, '__toString'));

            });



            if (count($strings) < 2 && count(array_filter([$retrieved, $value], 'is_object')) == 1) {
<?php     protected function execute($container)

    {

        try {

            $this->result = is_object($this->callback)

                ? $container->call([$this->callback, '__invoke'], $this->parameters)

                : $container->call($this->callback, $this->parameters);