src/Utility/VarPrinter.php
protected static function readObject($object): string
    {
        if ($object instanceof Closure) {
            return 'Function';
        }

        if ($object instanceof DateTime) {
            return sprintf('DateTime(%s)', $object->format('Y-m-d\TH:i:sP'));
        }

        if (method_exists($object, 'toString')) {
            return (string) $object->toString();
        }

        if (method_exists($object, '__toString')) {
            return (string) $object;
        }

        return sprintf('Object(%s)', get_class($object));
    }
protected static function readObject($object): string
    {
        if ($object instanceof Closure) {
            return 'Function';
        }

        if ($object instanceof DateTime) {
            return sprintf('DateTime(%s)', $object->format('Y-m-d\TH:i:sP'));
        }

        if (method_exists($object, 'toString')) {
            return (string) $object->toString();
        }

        if (method_exists($object, '__toString')) {
            return (string) $object;
        }

        return sprintf('Object(%s)', get_class($object));
    }
protected static function readObject ( $ object ) : string { if ( $ object instanceof Closure ) { return 'Function' ; } if ( $ object instanceof DateTime ) { return sprintf ( 'DateTime(%s)' , $ object -> format ( 'Y-m-d\TH:i:sP' ) ) ; } if ( method_exists ( $ object , 'toString' ) ) { return ( string ) $ object -> toString ( ) ; } if ( method_exists ( $ object , '__toString' ) ) { return ( string ) $ object ; } return sprintf ( 'Object(%s)' , get_class ( $ object ) ) ; }
Reads a string representation from an object

@param object $object The object

@return string
Reads a string representation from an object