Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87235 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7949 invoked from network); 22 Jul 2015 18:49:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2015 18:49:32 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.217.181 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.217.181 mail-lb0-f181.google.com Received: from [209.85.217.181] ([209.85.217.181:36304] helo=mail-lb0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/12-27316-AB5EFA55 for ; Wed, 22 Jul 2015 14:49:31 -0400 Received: by lbbqi7 with SMTP id qi7so62280084lbb.3 for ; Wed, 22 Jul 2015 11:49:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=GpgkZh6uk1UDu5DgGrgLE/iW1W0j9eR0SEBSn+ZsN1A=; b=Cv/8N3wWjtiMy50xguA3PeVPYfJA3bTi1M6X5tiPx6V2ClaqKecpyZum3N9K8YTKKX kbPrkWMO9LeEjxdXTNZ/XBleolUSQ2R6265iA+K1WxCe4dSGCmccla+hAo0/W3jvTcek 45KgVSZM8Ze4p6amiclkexJ9OXieRzKCoQeLFwlDILY7i7AsAr1y5ydX53Y3tWnPzYZo S7vey869Tt2E55JwxFwlwZGTI8noK3WdIbQnH6b9EBgH/uceyZL/u2WFrJJ7ihq634jn 656RLBYCsQQcN1gK5QVS9fksmAdKK0pCE3AnV7+jrWYIi7SrJZwFsgRX5x+fMsH3v0TV gU6g== X-Gm-Message-State: ALoCoQn9zCF+d5FLdhbXuTZeLMDg1iqOH7bvvsUX0BmnbyaNC1QKo4apxFAKZCn8DPUexpaCztVv MIME-Version: 1.0 X-Received: by 10.112.151.178 with SMTP id ur18mr3763791lbb.59.1437590967337; Wed, 22 Jul 2015 11:49:27 -0700 (PDT) Sender: php@golemon.com Received: by 10.112.11.134 with HTTP; Wed, 22 Jul 2015 11:49:27 -0700 (PDT) X-Originating-IP: [2620:10d:c081:f80::8:6606] In-Reply-To: <55AF84C1.8070403@fedoraproject.org> References: <55AF84C1.8070403@fedoraproject.org> Date: Wed, 22 Jul 2015 11:49:27 -0700 X-Google-Sender-Auth: dGUQMRyUx6YKJT1P51hX8-BQ0j0 Message-ID: To: Remi Collet Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] RFE to allow dirname($foo, 2) From: pollita@php.net (Sara Golemon) On Wed, Jul 22, 2015 at 4:55 AM, Remi Collet wrote: > See https://bugs.php.net/bug.php?id=70112 > I'm not inherently against it, but this really really sounds like a job for a userspace function. function dirname_n($path, $n) { while (($path !== '.') && $n--) $path = dirname($path); return $path; } -Sara