Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87236 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9709 invoked from network); 22 Jul 2015 18:57:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2015 18:57:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=ocramius@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ocramius@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.178 as permitted sender) X-PHP-List-Original-Sender: ocramius@gmail.com X-Host-Fingerprint: 209.85.212.178 mail-wi0-f178.google.com Received: from [209.85.212.178] ([209.85.212.178:36216] helo=mail-wi0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/72-27316-AA7EFA55 for ; Wed, 22 Jul 2015 14:57:46 -0400 Received: by wicgb10 with SMTP id gb10so111271061wic.1 for ; Wed, 22 Jul 2015 11:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=weLt9AjqTkz+P9Al1pDHqKKIIRcrnLXCDI+VpDnYsb8=; b=UIX7GSxTJfCbtvZXOGaaMGq8x18DiwdO1QmWkMuvKUJ93bJsxrGYxjR5nXdfYD9J2l LSH6j93BdcJx0H1xoAeGSKNr/h0QA0+bCQ9iQV9xZHIeasJLbxWCY0b/5jSz5SwsJr3g Zi0shpXHQcnHsqe5E4zxKnYjE/4RMgAeXXy6wmj9rv9U4tNq8AhWXo5RElzvLuTLKdT7 ui0QVODvagPoCiJtLhXwkWke7sVblKR16kV95VvO3Tbdy6/Nd74hzaLTl2F592q+sSF7 /ers70P191BheFw/SCiB90qa2+t33Y+UpOugR4Cp+lU4oJX+J0RMCmLZIcYabIein/mX ympQ== X-Received: by 10.180.187.167 with SMTP id ft7mr43408623wic.26.1437591463313; Wed, 22 Jul 2015 11:57:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.49.133 with HTTP; Wed, 22 Jul 2015 11:57:23 -0700 (PDT) In-Reply-To: References: <55AF84C1.8070403@fedoraproject.org> Date: Wed, 22 Jul 2015 19:57:23 +0100 Message-ID: To: Sara Golemon Cc: Remi Collet , PHP internals Content-Type: multipart/alternative; boundary=001a11c37f7e80c635051b7b5869 Subject: Re: [PHP-DEV] RFE to allow dirname($foo, 2) From: ocramius@gmail.com (Marco Pivetta) --001a11c37f7e80c635051b7b5869 Content-Type: text/plain; charset=UTF-8 On 22 July 2015 at 19:49, Sara Golemon wrote: > 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; > } > > Indeed. What need is there to add a functionality to a relatively simple function like this one? What's the actual advantage that cannot be achieved in userland code? Greets, Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ --001a11c37f7e80c635051b7b5869--