Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96284 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11128 invoked from network); 7 Oct 2016 10:56:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Oct 2016 10:56:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@ohgaki.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@ohgaki.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ohgaki.net designates 180.42.98.130 as permitted sender) X-PHP-List-Original-Sender: yohgaki@ohgaki.net X-Host-Fingerprint: 180.42.98.130 ns1.es-i.jp Received: from [180.42.98.130] ([180.42.98.130:54010] helo=es-i.jp) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 16/C6-23443-55F77F75 for ; Fri, 07 Oct 2016 06:56:23 -0400 Received: (qmail 55757 invoked by uid 89); 7 Oct 2016 10:56:17 -0000 Received: from unknown (HELO mail-qk0-f181.google.com) (yohgaki@ohgaki.net@209.85.220.181) by 0 with ESMTPA; 7 Oct 2016 10:56:17 -0000 Received: by mail-qk0-f181.google.com with SMTP id o68so39494481qkf.3 for ; Fri, 07 Oct 2016 03:56:17 -0700 (PDT) X-Gm-Message-State: AA6/9RnxQF/IafNTekCOSD14jkj8qbUR5t2zQs183ZFTvyQTJJ9A0dKsIE91v10xM/PLHAVMWbmAB7gf0hQhaA== X-Received: by 10.55.145.197 with SMTP id t188mr18250521qkd.233.1475837771368; Fri, 07 Oct 2016 03:56:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.84.168 with HTTP; Fri, 7 Oct 2016 03:55:30 -0700 (PDT) In-Reply-To: References: Date: Fri, 7 Oct 2016 19:55:30 +0900 X-Gmail-Original-Message-ID: Message-ID: To: =?UTF-8?Q?Micha=C5=82_Brzuchalski?= Cc: Marco Pivetta , David Walker , Stephen Reay , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Bug #72811 - Replacing parse_url() From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Michal, On Fri, Oct 7, 2016 at 6:47 PM, Micha=C5=82 Brzuchalski wrote: > 2016-10-07 11:21 GMT+02:00 Micha=C5=82 Brzuchalski : > >> How about complete rewrite with OOP? It could be implemented using Objec= ts >> like DateTime does. >> I've got working implementation in userland https://github.com/madkom/ur= i it >> maybe not be finished yet but supports parsing URI with IPv4, IPv6 and >> Hostnames. >> It was also going to parse query arguments from URI depending on how to >> parse multiple arguments: >> * some languages parses `?arg1=3D1&arg1=3D2` as an array, PHP parses onl= y last, >> * `?arg1[]=3D1&arg1=3D3` some parses adding element 3 to "arg1" array so= me >> replaces) >> >> This implementation also supports UriTemplates (" >> http://localhost/{module}/action") and UriReferences >> ("/some/reference?arg1=3D2#fragment"). >> > > My proposed impl supports parsing and building, I can see there is possib= le > to move functionalities from few global functions into one OO written > package. This is about internal C module implementation. re2c is one of the best way to write manageable BNF definition implementation. We use re2c many places already. Therefore, re2c implementation is the way to go. IMHO. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net