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;
        }
    }