Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96339 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76287 invoked from network); 13 Oct 2016 15:00:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Oct 2016 15:00:30 -0000 Authentication-Results: pb1.pair.com header.from=dave+php@mudsite.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dave@mudsite.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain mudsite.com designates 209.85.215.41 as permitted sender) X-PHP-List-Original-Sender: dave@mudsite.com X-Host-Fingerprint: 209.85.215.41 mail-lf0-f41.google.com Received: from [209.85.215.41] ([209.85.215.41:34478] helo=mail-lf0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C3/6E-41968-B81AFF75 for ; Thu, 13 Oct 2016 11:00:27 -0400 Received: by mail-lf0-f41.google.com with SMTP id b81so138001985lfe.1 for ; Thu, 13 Oct 2016 08:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mudsite-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=y18wZWLmgzlSbDC/ocEolDRgURaq2J11PPN9UPDyFVk=; b=nhM03XBTy5WDZBABl37BwRQmfjAyhhJuWXL6SQlt2BlBBu6UCQyb0/UMBkzelZQOC/ hyTDKCKckWoP7RK44AtglmmwcHULl5iXfHMFt0cP/junS3EE6T2qYcdkzss7yK7ktjFH nqUqVwSNFggPbCQ1khiblGwaumnz9l7eGXKwhlONnPJjdF152WFPt+TTwPiZr56FFYg2 /dHPJapKHvWRPN3hpuTDEzgi3Z1kYP4c7J+oJNUN92ST2fwxc3uicp2fFxZrzHEfBUIz ru9Y0KuPCKvdROYQvr2oPUR1jhsPas11npdKbTKl5GcM/L4MQTWyi2fGQ3W/oK+BzRJC +Dag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=y18wZWLmgzlSbDC/ocEolDRgURaq2J11PPN9UPDyFVk=; b=jjYTTf9PsQM+CnrWohGOOQmTSEyZeonefjSi6JPsEyxYz/+I6jG/IlzCQjKrA/sFo6 DdBITINe41kPkHynaIx+8ZDqkrpg9B+IlbFDqijqOjIsjFnp6H6Cr0zmYqcWKGS/GSyQ 5nOLni5/Jv+7sl7jDLTwXvFs2lDTcdWX6ZNYXpMlXUiaM5o6evud2g/v+B4yZV7J+1BF Bn9YTsjPTHCxGPJ9NXDqsgC2e98fyaFct9oUQgEv9EdPkmhdQJ2Y7pgDCtRb5bb8NqVK FSYj1MirAAKqqJNyFqIaYGlIuMQZrAwATg7zdKAHORTjo12Z/lndZplQsWbxKCw5D+KQ GgDw== X-Gm-Message-State: AA6/9RnPTb4XIxcEirsOWtXFv3eEcHa9Yj5jx+VLk7/yRoxWPXuIHO9ZAf82arJy/h1ZuJy1JZbzXYX48el6Zw== X-Received: by 10.25.66.72 with SMTP id p69mr6822778lfa.82.1476370821342; Thu, 13 Oct 2016 08:00:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 13 Oct 2016 15:00:10 +0000 Message-ID: To: Larry Garfield , internals@lists.php.net Content-Type: multipart/alternative; boundary=94eb2c1a07c85cfe94053ec05ecb Subject: Re: [PHP-DEV] [RFC] Bug #72811 - Replacing parse_url() From: dave+php@mudsite.com (David Walker) --94eb2c1a07c85cfe94053ec05ecb Content-Type: text/plain; charset=UTF-8 On Mon, Oct 10, 2016 at 1:22 PM Larry Garfield wrote: > Be aware that a user-space definition for a URL object already exists as > part of PSR-7: > > http://www.php-fig.org/psr/psr-7/#3-5-psr-http-message-uriinterface > > A core-provided mutable and incompatible object would be problematic. > > What would be useful would be to have a C-level function (parse_url() or > otherwise) that can generate a very well-known and standardized array > structure (ie, better than parse_url()s now) that a UriInterface > implementation could trivially wrap. Basically, a way to simplify this > existing code: > > > https://github.com/zendframework/zend-diactoros/blob/master/src/Uri.php#L435 > > And move the conditionals and filter*() sub-calls to C. (Right now they > play games with regexes and hope.) > Hi Larry, I guess I'm not sure why having a RFC/WHATWG compliant parser would be problematic with regard to PSR-7. It would be the application developers responcibility to take a standardized output and populate their object that implements UriInterface. WHATWG does seem to mitigate the need of some of the filter*() calls, but certain ones would still desire to be application-specific. Although WHATWG does not specify that the URL object has a getAll()-esque method, it could be beneficial to have something that returns a structure similar to what parse_url() does today. It could also be beneficial to just have URL implement ArrayAccess so you wouldn't have to bother with getting a specific array back, and can just access what you need. -- Dave --94eb2c1a07c85cfe94053ec05ecb--