src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php
/**
     * Casts an object to an array representation.
     *
     * @param Stub $stub     The Stub for the casted object
     * @param bool $isNested True if the object is nested in the dumped structure
     *
     * @return array The object casted as array
     */
Casts an object to an array representation.
@param Stub $stub     The Stub for the casted object
@param bool $isNested True if the object is nested in the dumped structure

@return array The object casted as array
Casts an object to an array representation . @param Stub $stub The Stub for the casted object @param bool $isNested True if the object is nested in the dumped structure @return array The object casted as array
protected function castObject(Stub $stub, $isNested)
    {
        $obj = $stub->value;
        $class = $stub->class;
        if (isset($class[15]) && "\0" === $class[15] && 0 === strpos($class, "class@anonymous\x00")) {
            $stub->class = get_parent_class($class).'@anonymous';
        }
        if (isset($this->classInfo[$class])) {
            list($i, $parents, $hasDebugInfo) = $this->classInfo[$class];
        } else {
            $i = 2;
            $parents = [$class];
            $hasDebugInfo = method_exists($class, '__debugInfo');
            foreach (class_parents($class) as $p) {
                $parents[] = $p;
                ++$i;
            }
            foreach (class_implements($class) as $p) {
                $parents[] = $p;
                ++$i;
            }
            $parents[] = '*';
            $this->classInfo[$class] = [$i, $parents, $hasDebugInfo];
        }
        $a = Caster::castObject($obj, $class, $hasDebugInfo);
        try {
            while ($i--) {
                if (!empty($this->casters[$p = $parents[$i]])) {
                    foreach ($this->casters[$p] as $callback) {
                        $a = $callback($obj, $a, $stub, $isNested, $this->filter);
                    }
                }
            }
        } catch (\Exception $e) {
            $a = [(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '').'⚠' => new ThrowingCasterException($e)] + $a;
        }
        return $a;
    }
protected function castObject ( Stub $ stub , $ isNested ) { $ obj = $ stub -> value ; $ class = $ stub -> class ; if ( isset ( $ class [ 15 ] ) && " \0 " === $ class [ 15 ] && 0 === strpos ( $ class , " class@anonymous \x00 " ) ) { $ stub -> class = get_parent_class ( $ class ) . '@anonymous' ; } if ( isset ( $ this -> classInfo [ $ class ] ) ) { list ( $ i , $ parents , $ hasDebugInfo ) = $ this -> classInfo [ $ class ] ; } else { $ i = 2 ; $ parents = [ $ class ] ; $ hasDebugInfo = method_exists ( $ class , '__debugInfo' ) ; foreach ( class_parents ( $ class ) as $ p ) { $ parents [ ] = $ p ; ++ $ i ; } foreach ( class_implements ( $ class ) as $ p ) { $ parents [ ] = $ p ; ++ $ i ; } $ parents [ ] = '*' ; $ this -> classInfo [ $ class ] = [ $ i , $ parents , $ hasDebugInfo ] ; } $ a = Caster :: castObject ( $ obj , $ class , $ hasDebugInfo ) ; try { while ( $ i -- ) { if ( ! empty ( $ this -> casters [ $ p = $ parents [ $ i ] ] ) ) { foreach ( $ this -> casters [ $ p ] as $ callback ) { $ a = $ callback ( $ obj , $ a , $ stub , $ isNested , $ this -> filter ) ; } } } } catch ( \ Exception $ e ) { $ a = [ ( Stub :: TYPE_OBJECT === $ stub -> type ? Caster :: PREFIX_VIRTUAL : '' ) . '⚠' =  n w T rowingCasterException($ e ) ] + $ ; } return $ a ; }
Casts an object to an array representation.
Casts an object to an array representation .