Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124292 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id DA0FB1A009C for ; Mon, 8 Jul 2024 17:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720459547; bh=jsm7pfDfxPdU7/MyQpZyiHaAvf4CH6s4ZgtJsNwEYC4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=YJwmjJ5B7ZlYp6OoDOKNsb8CEays45+FYy5tualfs+XfKoU2qwOLztgGSwD/6ENh6 yvjecSuLxRPA/rLaIkCh+1mrvM618j0euqbtL5t++aT+Xs5CqrTUaJ6LONkXrVqjK5 zL4wycqCjZ4RE7fZcS665fuq5GI7VCvLCde8KFhYvo3b13tQA0rYtNFtIf15g1+aXR n02BKPQTU6KOr/5aS/+ubaq/haBLp5Gu+Yv4ZCy/9eRcGCRhKptt1+uUaNnctq1HUL vu5iK5mzO90DZ7/c73Tc2tqw+s10ka5r1B/5pH92np3iqA5dIeUz3nujrErUGUjRQH odWEWOeIiq9Rg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C1031180069 for ; Mon, 8 Jul 2024 17:25:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 8 Jul 2024 17:25:46 +0000 (UTC) Received: by mail-vs1-f47.google.com with SMTP id ada2fe7eead31-48feaeaa705so1355919137.2 for ; Mon, 08 Jul 2024 10:24:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720459461; x=1721064261; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=jsm7pfDfxPdU7/MyQpZyiHaAvf4CH6s4ZgtJsNwEYC4=; b=UUDX9u35wjvR9V+IK/tvJQbAeNAeW2hO0SIhIKeTKC/m8AfCu6xR7JSohfvKEPkbKD Rc234Jbmp8BVPlQWtpxcFlqeSnHURzuS24Cc+K2sYZXmDVghl50+P6E3U1jyt0C0OMFT F90OeuHGLgFn/XhRqA4ePNC5immfdvfvATMUfyXkOo+aHTmT4O9vvT4c6C7+q6xrCPrg VA1QfYh0EQToRtsnhcBUiVMa4kKuWknqUD8Pz7i40LURj4FICm8H5Il63W11X49VusJo 4yAhMy7r6fDvzCbfCYycYMmTrHUwhV23/awfxhUK3cKaxbjN0aDwMi+RMA/r5Huiyl+s Ospg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720459461; x=1721064261; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jsm7pfDfxPdU7/MyQpZyiHaAvf4CH6s4ZgtJsNwEYC4=; b=bKKgQrUs42GVHlj7e8Y9vbhpQf4waF3p0jpZGw4Pr329MwDPm+9MNShz9G9ZXwlP9P V5rSIGdhZCayzP2w+l6QQICcrhICTw0em3oVurzV5bUjPxs0kOUBcVR4IVZzOrrgm4M8 imGFAHVz58x0JPZEbWusQtfT5ShD07NSoD+cwT55qtQ3oCJ2CicdJpPDANDzOE9acnUf JoMdoQ2C1CBwObgPkPukJO84KBNa6OUaD1+O2ul/KIqtBpezabpT5x0zZdsCE0JQPgF4 R5UHVF0BA1xqaOsWcl7BBpT39W5GgcBNwyOfi93NCERx18xhBdGnuOpZBBhZbyWLl+2u 0qZQ== X-Gm-Message-State: AOJu0YyKDZZS0j7yfhyW8vReBDt5tj77oPgkrtbGZbb0Rxnp5iCwvKIH A6Qnl3ZKyaUVn9aia3Wdh5a2UxHdS4TwgtRDWtWU+U9D2+yJB23ZLo5zQw4N62Avk/ucqB8agWR jSq9bg7JF1sd3uPkkxaraLrEr9B0= X-Google-Smtp-Source: AGHT+IE6r44x4Rh4zaRi5lf5BC1cfTVUUX0BruZgnbH6vs4tygm1jek6BZa9KEIFxWDUKVertCzm3oHViYO/0j5W0IQ= X-Received: by 2002:a05:6102:956:b0:48f:e636:2719 with SMTP id ada2fe7eead31-49032137e7cmr154254137.13.1720459460835; Mon, 08 Jul 2024 10:24:20 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 8 Jul 2024 11:24:09 -0600 Message-ID: Subject: Re: [PHP-DEV] [RFC] [Discussion] Add WHATWG compliant URL parsing API To: =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= Cc: PHP Internals List Content-Type: multipart/alternative; boundary="00000000000003853e061cbfaf4c" From: lnearwaju@gmail.com (Lanre) --00000000000003853e061cbfaf4c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jun 28, 2024 at 3:38=E2=80=AFPM M=C3=A1t=C3=A9 Kocsis wrote: > Hi Everyone, > > I've been working on a new RFC for a while now, and time has come to > present it to a wider audience. > > Last year, I learnt that PHP doesn't have built-in support for parsing > URLs according to any well established standards (RFC 1738 or the WHATWG > URL living standard), since the parse_url() function is optimized for > performance instead of correctness. > > In order to improve compatibility with external tools consuming URLs (lik= e > browsers), my new RFC would add a WHATWG compliant URL parser functionali= ty > to the standard library. The API itself is not final by any means, the RF= C > only represents how I imagined it first. > > You can find the RFC at the following link: > https://wiki.php.net/rfc/url_parsing_api > > Regards, > M=C3=A1t=C3=A9 > > I was exploring wrapping ada_url for PHP ( https://github.com/lnear-dev/ada-url). It works, but it's a bit slower, likely due to the implementation of the objects. I was planning to embed the zvals directly in the object, similar to PhpToken, but I haven't had the chance and don't really need it anymore. Shouldn't be too much work to clean it up though --00000000000003853e061cbfaf4c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Fri, Jun 28, 2024 at 3:38=E2=80=AFPM M= =C3=A1t=C3=A9 Kocsis <kocsismate90@gmail.com> wrote:
Hi Everyone,

I've been working on a new RFC for a while now, and time has co= me to present it to a wider audience.

Last year, I= learnt that PHP doesn't have built-in support for parsing URLs accordi= ng to any well established=C2=A0standards (RFC=C2=A01738 or the WHATWG URL = living standard), since the parse_url() function is optimized for performan= ce instead of correctness.

In order to improve com= patibility with external tools consuming=C2=A0URLs (like browsers), my new = RFC would add a WHATWG compliant URL parser functionality to the standard l= ibrary. The API itself is not final by any means, the RFC only represents h= ow I imagined it first.

You can find the RFC at th= e following link:=C2=A0https://wiki.php.net/rfc/url_parsing_api
<= br>
Regards,
M=C3=A1t=C3=A9

<= /blockquote>

I was exploring wrapping ada_url for PHP (https://github.com/lnear-dev/ada-url). It works, but it's a bi= t slower, likely due to the implementation of the objects. I was planning t= o embed the zvals directly in the object, similar to PhpToken,= but I haven't had the chance and don't really need it anymore. Sho= uldn't be too much work to clean it up though=C2=A0
--00000000000003853e061cbfaf4c--