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 static function invalidPlatformType($invalidPlatform): self

    {

        if (is_object($invalidPlatform)) {

            return new self(

                sprintf(

                    "Option 'platform' must be a subtype of '%s', instance of '%s' given",
<?php         foreach ($this->sqlParts as $part => $elements) {

            if (is_array($this->sqlParts[$part])) {

                foreach ($this->sqlParts[$part] as $idx => $element) {

                    if (! is_object($element)) {

                        continue;

                    }
<?php                     $this->sqlParts[$part][$idx] = clone $element;

                }

            } elseif (is_object($elements)) {

                $this->sqlParts[$part] = clone $elements;

            }

        }
<?php         }



        foreach ($this->params as $name => $param) {

            if (! is_object($param)) {

                continue;

            }
<?php     public static function export($var, int $maxDepth)

    {

        $isObj = is_object($var);



        if ($var instanceof Collection) {

            $var = $var->toArray();
<?php         }



        if ($maxDepth === 0) {

            return is_object($var) ? get_class($var)

                : (is_array($var) ? 'Array(' . count($var) . ')' : $var);

        }
<?php         return new self(sprintf(

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

            is_object($value) ? get_class($value) : gettype($value),

            $toType,

            implode(', ', $possibleTypes)

        ), 0, $previous);
<?php     public static function conversionFailedSerialization($value, $format, $error)

    {

        $actualType = is_object($value) ? get_class($value) : gettype($value);



        return new self(sprintf(

            "Could not convert PHP type '%s' to '%s', as an '%s' error was triggered by the serialization",