Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124000 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 C03F81A009C for ; Fri, 28 Jun 2024 21:02:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719608637; bh=zF14H9HSZQD4xYQIx3FRwWlXOW0oFZbfbc1+6A/tZwk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LYzyBqjVNzgKY0oTJYOhyD1gBjrpGD2n6045c8FD5SRym1scyv9PEmz64m31e8GV1 A97knlaFt83DQ8tPMFzGZQn3HHtSuR4hAiKG2IamSq0gCvrI/5VX5gOJtdGCJBDxr0 seSLRCd8LK9Bi00ZCAzC/XL/pRd0kOaplJ4dhIhSoVB96nVpXSGHN7tTs+6tYV3ZAb 1f4zGqjXc/wvPTbgD4WWV6DHLNiN8eu/TTh/9DuaIcIWQw7aYEttmdx7aDi74Z9UIc 34kxPpXH7ejIURe2LMN3NOM/Lq933g001/N1uf6CRafhhSmgplpgsAT8qBz1DHWJCa mjfMic/NkhQyA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C30401801E0 for ; Fri, 28 Jun 2024 21:03:56 +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-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 ; Fri, 28 Jun 2024 21:03:56 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-57cc30eaf0aso643907a12.2 for ; Fri, 28 Jun 2024 14:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719608556; x=1720213356; 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=zF14H9HSZQD4xYQIx3FRwWlXOW0oFZbfbc1+6A/tZwk=; b=KLeAgGFtmAFW9NwIl/fSSlCO2Hx5ib9JzOdDgxcMvAPnwIaCYgPRPQiQYCDk/IcFio k/75zOsGSHV9INHfC1KIU6FEAiP7qfLqCC4ltlBoxIKWzBImNM/7fhflGWgjn8FX6adh EldTqZ27B5GsP8zxPTU9FnZOPsDRLj6P6mSGWojivDl9BDQtkXXvr+wjuKlIHv5BLBlj aJD8m10x2JKQxRqwGbL/pYt5gVboxNxbxy1Biizzl92Q2K637mNzOS/zw63FPoPj1v3O 6f7j43b304B0/MW4G+AeGOlNmv4nfQoF2XEhrdaADPzTA20Yk4DEBd3LVhecG5tCbreX 8oig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719608556; x=1720213356; 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=zF14H9HSZQD4xYQIx3FRwWlXOW0oFZbfbc1+6A/tZwk=; b=uM6MzloxcXNXVHuBp6z7uekMlOq4I/2ys76JH4BdZeQghfbLAqBTGKV+csdxAIZMTs KnZn5IyIXF1iFGO35NjM/5A9C/NjvKh53vqK9eFml17kA7B2KWxmFk9cyx5aC1Hp3ECl sFhxuizoGYhkAJWZm8kLbP8Qsa/CKNqUi91QHQYl7uS+6e1GFjB/zoHbxHwpPjEJnhB2 1O86nYtRmeoXthlG98gfX6vJmCuTQx90aTG3ZO6jF7CK6eOndP6qIKtMkBBbX4Ev2hxI Ks2y+YKwOa3FnL/LUO14RclXbcfsyBVACKb5bmKzP4rNdqtz046QeT/6SBGCAhYhGTGC 82TA== X-Gm-Message-State: AOJu0Yx0n1hP+cEdbH+f9C5ejlCdLV3Zuv5rg4dg+eh4KpqShmiEsaXF VDBJ4O6DFI3aXInm76xXRdFW1LTehv/kuwLnuN1JUvzakvsXNXIxCRZ3eFFmY8XiTEs3PZm6slD fElQCZ9Cgk4nNpSAzDLFK6onbyhPCe3kH X-Google-Smtp-Source: AGHT+IHTYENUn5+pneJIbe9Et/lIpO8sm6j5cIG8xaBK3EcAkkvtKkwK7qcjKUQhMwEMF9it97OWOMZYfEfWJ09MbkE= X-Received: by 2002:aa7:c34f:0:b0:57d:4f47:d9f7 with SMTP id 4fb4d7f45d1cf-57d4f47dc85mr15162547a12.0.1719608555988; Fri, 28 Jun 2024 14:02:35 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 28 Jun 2024 23:02:08 +0200 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="00000000000021ec01061bf991e4" From: kjarli@gmail.com (Lynn) --00000000000021ec01061bf991e4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jun 28, 2024 at 10:08=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 > > This is a great addition to have! I see there's nothing specifically about `__toString` in the RFC, is this aiming to do the same as PSR-7? --00000000000021ec01061bf991e4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, Jun 28, 2024 at 10:08=E2=80= =AFPM M=C3=A1t=C3=A9 Kocsis <k= ocsismate90@gmail.com> 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 wel= l established=C2=A0standards (RFC=C2=A01738 or the WHATWG URL living standa= rd), since the parse_url() function is optimized for performance instead of= correctness.

In order to improve compatibility wi= th external tools consuming=C2=A0URLs (like browsers), my new RFC would add= a WHATWG compliant URL parser functionality to the standard library. The A= PI itself is not final by any means, the RFC only represents how I imagined= it first.

You can find the RFC at the following l= ink:=C2=A0https://wiki.php.net/rfc/url_parsing_api

Regards,
M=C3=A1t=C3=A9

<= div>
This is a great addition to have! I see there's noth= ing specifically about `__toString` in the RFC, is this aiming to do the sa= me as PSR-7?
--00000000000021ec01061bf991e4--