Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119225 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35100 invoked from network); 3 Jan 2023 15:43:52 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Jan 2023 15:43:52 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1A9571804BE for ; Tue, 3 Jan 2023 07:43:52 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8560 212.227.0.0/16 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 3 Jan 2023 07:43:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1672760629; bh=hjRWFNH5atpvYbVYDEFzaQcEzjt1brjeH095kP4bMI8=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=W+C25/vMcAVvNiZHnMEkjcoDouqZu8Yz0I8Ka3HKE+yDIAk6SsUHIb7X0p+/jbvr9 P9eCLXcwFbgn/dBDKjq1NssUse/Z0XTRa7+8H4zOTirMJjlx7+vl/CMLtbtEXJJLfq YquoENPnQkoqSsXWZWYucpU+brBgx5FMFI6MWZ6hOgpTprxkF03/FZ1WIomD2Q/dPW QqV036dDFN1k3/GbEQ37JKGHU2A+dvFeR1VM8qVhwzDeQrfprVzLHnvpXVw4Wjex3C zOQy7rLf8ZwnnuleN+7XQl6MFQCqqpfhUNIcrvdw5+yjzY/2ivy6W3SHVCaEtGlPhG 3t/4UTZ8BbnvQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.2.130] ([79.220.80.221]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M5QFB-1pBtyK0LRd-001Vg4; Tue, 03 Jan 2023 16:43:49 +0100 Message-ID: <42306d40-5e47-b571-5898-6d7739302ab3@gmx.de> Date: Tue, 3 Jan 2023 16:43:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 To: Philip Hofstetter , PHP internals References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:UcS367sVxW5Q19NhqFLqEfhsweqRbbD0/bnred/cYAicg/Em8eS h73uVGg3PpT3QpFM7CvsHH7fSMNbgPHgbo85dWM+AD35VhYemLJmanhthBrBaBmVbECn/Mo 0q6f3i1GGBCDrXdY743NkqHNVDpDb/E6H2Y+AFypnIOllQTCxfLA/buGD2kk4/s31osy+pk znN9OMQOWuPsu9J+D8tew== UI-OutboundReport: notjunk:1;M01:P0:PYt35bpa+Vc=;11rG9YdjJrfloPwtKCmCc3xQSJK yavyNwhdC9E9DQ6PQZb9Tiu7L7berRJM4dTCB2VW6lvT19i79fpgd1YXBqpFQKMM2QiiRfnN0 0HX867/NCwHeWqbRJkkzaTQV0hbipea8grgpNlVtgJn6VEspg9gDE4q7w2/h8u38fE5VJijaV CPkg1Pnu2JVoY5afL0LfnaJjbQqIyupAJEp1EneA/oIFocfHO+as/VXMWx11EIxeu/lV/JkPL kbWi5hgkTz8ONbB5Cr3TEkFljRjftMrLtO4bqV6rt6GR+vQjhKo6RUA4MCDobH+CXhuC3KwdC NG9Jxt6NHeh3j+G1flV/BHGSOVU6xFs7lKVN9wwpzuh750w+awkiao/4iNno7d2SN0tYKMl0+ Z7xdwB9FWq859sdUT7W1RCYyNHtXCHbfY+kIKISTrKd2dkfuZDqwkfgSGcH05YFc/NUjuItbq ocMs5UNQ6u+qP4Adgx8vO7ty0cn0KCxXFInMcpXKergxve9HmjqTB5IyGf2H02/FC1/AkQ7Jx mbGW+k+OeV88O/MY3EGkh0rRz6BAfKp0sGbYWVz23dniOd0NID2FN7r8HnRBQCvg6t2hAedbQ av8Rf3fEeR7QT35tv6R7JNtULOnBHzdejx157BKSd17nkyFtzNnlqSEOMXOYS7hxEg4nESuH2 DXpG6Gsh9+lLO5HGVTDeG23IYIWvoIZJ/AUTSJTxjZb5E4NyjgxRwSe3VeqFbmfGNFJtjU3CF zzwqf8CyWrzIzGCIaRmypVLkwKJnz/zRrA8iBLw9HgsaJ4ZBR63Q/pnKDv2JD+9wQODlJj8/7 TfqStT88kCJlgF+jSFD5ovFApZRn4HLMZGSWJkCFULwDYE/BbAEqncmdTb4ArvJwiRIlL2waX qcvpW8R8IbXHDHjWxtwYQvDoV9eYVz1jz4KYBCIBD1iE4nfQHBI4tUbQKH8/+FU9c5vpVN2Ab ZyKzEA== Subject: Re: DateTimeImmutable::modify() return type: doc or language bug? From: cmbecker69@gmx.de ("Christoph M. Becker") On 03.01.2023 at 10:48, Philip Hofstetter wrote: > `DateTimeImmutable::modify()` is documented as returning > `DateTimeImmutable`, but it seems to actually be more specifically > returning `static`: > > https://3v4l.org/j9ZSo > > Now I'm wondering whether this is a documentation issue (where it > should return `static|false` and has not been updated to account for > that return type's availability yet) or whether this is a language > issue and the method is supposed to be returning `DateTimeImmutable` > instead, though that's probably a considerable BC break. It is not recommendable to extend DateTime(Immutable); these classes have not been designed for that; for instance (and that may actually be the only issue), __construct() is not called (). Of course, we cannot easily make them final, but I don't think we should encourage users to subclass by documenting return types as static =E2=80=93 besides that the current return type is not wrong (it's just not= as specific as it could be). > If you agree that it's a doc bug, I'll submit a PR. As of PHP 8.0.0, the single-source-of-truth regarding the signatures are the stub files[1]. The signatures in the PHP manual can be automatically generated from these. Therefore the stubs would need to be changed (first). [1] =2D- Christoph M. Becker