Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123404 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 923B71A009C for ; Wed, 22 May 2024 17:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1716400213; bh=jQ5jqsMaHUdWoE9tcFrOtPAyBfsfZA+mvJ488qVDUmk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=YDXkmLR1MAwSKukS2wgtxEUMOkYAHltUW7+kZbwcEoaKwnEz8d73LbwfL5/n4o5u/ YuTg8l/Udx5BDOOzk3naE9X22Gs3gO2DwjFcPAeS7jfIlW52OcCKwIQdUx7BrRxhDj TrhLFogetkopaiDe5qLjkyudHBG0+tgUdg/PLJfMpqdO+sBh+Jg1eDPyt+RoDq7ouy WGj9J8gUuQA6sJHfcUNoHd5ISLfiE3SpshkPPWwpz00+IF0tDWVaPn9yfEaLglTLhI yeqJpovo0ZAXKnhEfVFW1kAjmm3cJYD07CE1fIMtpbj49JzJxzZ/ovu0dX9nZbOPox CD67F439ZoGzA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 36FEB18005D for ; Wed, 22 May 2024 17:50:13 +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, 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-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 ; Wed, 22 May 2024 17:50:12 +0000 (UTC) Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-420180b5838so32693085e9.2 for ; Wed, 22 May 2024 10:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716400155; x=1717004955; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=FPhuK5z9X5v1WiLg/3qbJHh/tWwIjRgZm4EJ/dhBB20=; b=aHwP9rrrDQ25vVwhftsjajb0KMRGNvEqcw8KzqPAuBwVUhvwxaKpZ0oeaxuWc2A2PW GF7qs6a/x1GskhblU2O9MP5/g9LfvmSO5WvFnTbmQhmR/0so0yqP6JwwPUjM63+UOlRz CSdixLFDKM5sUZwzoWADR6VHhDAGTaZj0VUEacwFQvOxL9PZSIBn0Hey+FeXJQQkZwWT tHcZASu5Z23k8w+NtVSR+T/QkHfYjOUQFXPD0BzTM28iagucOfye4hE8kMS028xie6SW CIttk14GO7q3GhtkooF3wogjR9R5dKER0T6l25+ZMUBMiA+eK4I2ozHHrFvbgMlSyz5S ak2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716400155; x=1717004955; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FPhuK5z9X5v1WiLg/3qbJHh/tWwIjRgZm4EJ/dhBB20=; b=O46Uw+MZ6DPj0PIpJB9qGoT7/Qg8phHR+q3EdNsV+/gYzbeKvQOdMf3CecFpfoiRQD 2UEYJWyOiyKtGoIAiyQmBMezgWsEgLQtqpRzdWZZFBfHvT1eiY4vy9YrLwrWAh4HntY8 AsVGk9W/94XTJppAhNH1v+IMpgITF4lCcCSeOp8ezwf4bCqr6lUV+fb8WCWR894yQO3h QPHO6dRrWbkrAdWig9eh1LsIC9tn1T5A0Pzpqy164HwvT3HWrYcDjihlb28r2Wwon4z8 ID5Hltby25yqXVUnoZkmRABqmIENq6q1Yaicc5Fuyx4W8+8RlKhhmj6kgyoPI+xcLSHb w8ow== X-Gm-Message-State: AOJu0Ywh54aHHiJ497oNmwnEnImIIGu9prJgf6msmwPKxUhiO3KSwdDk 31gbzvhEP56V4b8zzPMz6Kl5sjp8Pw4IMNOELJM21bYmzoDEODXcMDWMug== X-Google-Smtp-Source: AGHT+IFdjw2NGFpJBFVSkHMJ0mQdUHsTSxNaFqf9Aatl8uVCxqxpQVSGfg7OBQGCL+G8dzn1kBIdHg== X-Received: by 2002:a05:600c:202:b0:41a:aa6:b59e with SMTP id 5b1f17b1804b1-420fd2db0d6mr24713785e9.5.1716400155060; Wed, 22 May 2024 10:49:15 -0700 (PDT) Received: from [192.168.0.102] (178-117-134-240.access.telenet.be. [178.117.134.240]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42100f591cbsm1080525e9.22.2024.05.22.10.49.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 May 2024 10:49:14 -0700 (PDT) Message-ID: <31b39501-e42f-4563-a4c6-1efafdf34512@gmail.com> Date: Wed, 22 May 2024 19:47:36 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] [Discussion] Add openStream() to XML{Reader,Writer} To: PHP internals References: <721C2420-62AB-4586-AFAA-2E831C678EB5@gmail.com> Content-Language: en-US In-Reply-To: <721C2420-62AB-4586-AFAA-2E831C678EB5@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: dossche.niels@gmail.com (Niels Dossche) On 21/05/2024 21:58, Claude Pache wrote: > > >> Le 21 mai 2024 à 21:00, Matthew Weier O'Phinney a écrit : >> >> (But again, I prefer that all those methods work on instances, as it was the case before PHP 8. They shouldn’t have been switched to static-but-broken-for-subclasses without discussion.) >> >> >> Fixing the existing ones would be a potential BC break, depending on whether or not instance usage is completely eliminated. > > Yes, of course. But there exist options that don’t 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()` > > … 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.) > > —Claude  Okay, that seems reasonable to me and I can do that. I'll make them return static and do "new static()" like I proposed with the new static method. For XMLWriter, I suppose we also want the static counterparts: * `XMLWriter::toMemory()` for `(new XMLWriter)->openMemory()` * `XMLWriter::toUri()` for `(new XMLWriter)->openUri()` If that sounds good I'll update the RFC. Niels