Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123387 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 5C4801A009C for ; Tue, 21 May 2024 19:58:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1716321584; bh=OsfEPzeQrkLXPQH+qCHAyx+TqKFZJgyWDJaES+JJzb8=; h=Subject:From:In-Reply-To:Cc:Date:References:To:From; b=ZVPNteBNGJ1qLusvwc2F94CugGlzCt8yBfriV5k0qRIgZQD24gY4WwDe7c9t2oM5Q 32a8rzrGBmMR4zW6f/rpyJdBZP5brKlu8Uocmf7vfvYoIRP2qclouPaJbsFLv5C+Q0 Px40AgjcndlYHhm9fSiBiKWk6eWI2fWTLXEiBCVKF+2End+uiR5hFEb2kl+RZAxw49 VpA5fImlbuze8JAcRb8jtfURG4GAwz0O2cBSGEkbPGEH1paD5E4RHZKcE+tsz9WD7S gxfZvrxy8O8/gf70ZHgL7mR3Q2vgxbDwxCfedRxLQs0n8usHYyyQhY8VTmg0PSR28n z4+9q9v4JWUfw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2EF42180579 for ; Tue, 21 May 2024 19:59:44 +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,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,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-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 ; Tue, 21 May 2024 19:59:43 +0000 (UTC) Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a61b70394c0so290492066b.1 for ; Tue, 21 May 2024 12:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716321526; x=1716926326; darn=lists.php.net; h=to:references:message-id:date:cc:in-reply-to:from:subject :mime-version:content-transfer-encoding:from:to:cc:subject:date :message-id:reply-to; bh=iaV3aQf/qH4cOl0RTOcXIs6jttB6JFnxEaCANW2u5Pg=; b=MpVZLXu7ZCP6GA6txBA96P3IN1ezKoYU0IFsVEleYSIMZ9wUnrJm0uNVIUipk+v7pc B8QhAvz5su9Q09lCJrOGYbAz8qpBCEj2PjsLFcTJ0d+WMspOpSZd24c7wTsDu291GfZL WEH0LR20n8WppB4CHyo1eNtSvRX/xNJCsTgoawxY8v+QlezGw7YG+tH6l1EuZcNEpSX0 YePXPB3j4MFUyB0HB8jiXAS02WO9ZTuNFMmSrbp36AJZgB3l9nP6QYaw8M0LVyABYnPD GDC1ElEblXSuJBElKyl0sH3DpDVwPHFhaG0V3lPlAfnCxJgZOGDYXb1gqhRqEzSjtlMn 15Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716321526; x=1716926326; h=to:references:message-id:date:cc:in-reply-to:from:subject :mime-version:content-transfer-encoding:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=iaV3aQf/qH4cOl0RTOcXIs6jttB6JFnxEaCANW2u5Pg=; b=pZKLeghXmPMmUElO9kpihFfrxsvdX2hLLXIbkm9WjKXyh9mwX0aqVJo05bMRia24IG izzVex76O3KbxtYD9Ryqz0hZBPqjpzyDI1hOSkZD/R4ZfVo7ycgHT4BAqJd0GzevoVlY 4KwTdB6CPV1nXf1w7gJ0Y8EvEr0/yo71+7C3JNdGrOaj7bQv11k2XcGJLBxCARE16GZn NriA7co/lzEPsqQmwiaSd7HCCNSsOmXNzXHm5EVBttAXkwvLpaVTTzo9oyCE1gaFpbzL Lns0oM296IwqdoSeJJ10j0PURMwl8VeZOe+PfCc9U8qGJhaUE0S/DEpRqOsSG5J/l8J4 pX1A== X-Forwarded-Encrypted: i=1; AJvYcCXjW74b18qlTNLiLeG3ksMVAcI+wHSGybGbMK95HAe8Lwag5Tcp5vyQRb+4UsR8QKdoAcaEhSuavtLM9VXfVKbg0BY0XTRUug== X-Gm-Message-State: AOJu0YwDQWXE/vWxCokzE5N5VmsAsLQiaGO7WMH69HnCypvfxwJp+8tO JcX6+X5pkEY5GaeWIDrshMCfcmhaeyIihcnYTuBtlVre31uuNnkb X-Google-Smtp-Source: AGHT+IFRu0vUf6arSd4fnbLBuzR7qy0RzdeXNstaEY5k3yY9BlzcNflDWPe+VR9C6PDXPhpjw/t/sw== X-Received: by 2002:a17:907:36f:b0:a52:6fcb:564a with SMTP id a640c23a62f3a-a5a2d53aa70mr2214487766b.9.1716321526346; Tue, 21 May 2024 12:58:46 -0700 (PDT) Received: from smtpclient.apple ([178.197.222.212]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a60eabd3csm1260677066b.108.2024.05.21.12.58.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 May 2024 12:58:45 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-AE02AFCD-D6FA-47F1-BBA4-10AF9FA451CA Content-Transfer-Encoding: 7bit Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] [RFC] [Discussion] Add openStream() to XML{Reader,Writer} In-Reply-To: Cc: Niels Dossche , PHP internals Date: Tue, 21 May 2024 21:58:34 +0200 Message-ID: <721C2420-62AB-4586-AFAA-2E831C678EB5@gmail.com> References: To: Matthew Weier O'Phinney X-Mailer: iPhone Mail (21D61) From: claude.pache@gmail.com (Claude Pache) --Apple-Mail-AE02AFCD-D6FA-47F1-BBA4-10AF9FA451CA Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > Le 21 mai 2024 =C3=A0 21:00, Matthew Weier O'Phinney a =C3=A9crit : >> (But again, I prefer that all those methods work on instances, as it was t= he case before PHP 8. They shouldn=E2=80=99t have been switched to static-bu= t-broken-for-subclasses without discussion.) >=20 > Fixing the existing ones would be a potential BC break, depending on wheth= er or not instance usage is completely eliminated. Yes, of course. But there exist options that don=E2=80=99t make the API even= more inconsistent than it already is. I hereby propose: * `XMLReader::fromUrl()` as replacement for `(new XMLReader)->open()` * `XMLReader::fromString()` as replacement for `(new XMLReader)->xml()` =E2=80=A6 which would make me happy. (The old, inconsistently-named, instanc= e-and-semi-broken-static methods could be kept for BC and marked as soft-dep= recated in the manual.) =E2=80=94Claude=20= --Apple-Mail-AE02AFCD-D6FA-47F1-BBA4-10AF9FA451CA Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
<= div dir=3D"ltr">


Le 21 mai 2024 =C3=A0 21:00, Matthew Weier= O'Phinney <mweierophinney@gmail.com> a =C3=A9crit :

(But again, I prefer that all those methods wor= k on instances, as it was the case before PHP 8. They shouldn=E2=80=99t have= been switched to static-but-broken-for-subclasses without discussion.)
<= /blockquote>

Fixing the existing ones would be a potentia= l BC break, depending on whether or not instance usage is completely elimina= ted.

Yes, of course. But there e= xist options that don=E2=80=99t make the API even more inconsistent than it a= lready is. I hereby propose:

* `XMLReader::fromUrl(= )` as replacement for `(new XMLReader)->open()`
* `XMLReader::f= romString()` as replacement for `(new XMLReader)->xml()`

=E2=80=A6 which would make me happy. (The old, inconsistently-named= , instance-and-semi-broken-static methods could be kept for BC and marked as= soft-deprecated in the manual.)

=E2=80=94Claude&nb= sp;
= --Apple-Mail-AE02AFCD-D6FA-47F1-BBA4-10AF9FA451CA--