private static function recursiveImplode($glue, $pieces)
    {
        if (is_array($pieces)) {
            $strings = array();
            foreach ($pieces as $key => $piece) {
                if (is_int($key) || $key !== self::ATTRIBUTES) {
                    if (is_array($piece)) {
                        $strings[$key] = static::recursiveImplode($glue, $piece);
                    } else {
                        $strings[$key] = (string) $piece;
                    }
                }
            }
            return implode($glue, $strings);
        } else {
            return (string) $pieces;
        }
    }
private static function recursiveImplode($glue, $pieces)
    {
        if (is_array($pieces)) {
            $strings = array();
            foreach ($pieces as $key => $piece) {
                if (is_int($key) || $key !== self::ATTRIBUTES) {
                    if (is_array($piece)) {
                        $strings[$key] = static::recursiveImplode($glue, $piece);
                    } else {
                        $strings[$key] = (string) $piece;
                    }
                }
            }
            return implode($glue, $strings);
        } else {
            return (string) $pieces;
        }
    }
private static function recursiveImplode ( $ glue , $ pieces ) { if ( is_array ( $ pieces ) ) { $ strings = array ( ) ; foreach ( $ pieces as $ key => $ piece ) { if ( is_int ( $ key ) || $ key !== self :: ATTRIBUTES ) { if ( is_array ( $ piece ) ) { $ strings [ $ key ] = static :: recursiveImplode ( $ glue , $ piece ) ; } else { $ strings [ $ key ] = ( string ) $ piece ; } } } return implode ( $ glue , $ strings ) ; } else { return ( string ) $ pieces ; } }
Recursively implode nested ArrayAccess

@param string $glue Glue to hold together imploded list of pieces
@param array $pieces
@return string
Recursively implode nested ArrayAccess