Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110563 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 42586 invoked from network); 16 Jun 2020 08:51:52 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 Jun 2020 08:51:52 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5BB151804CE for ; Tue, 16 Jun 2020 00:37:15 -0700 (PDT) 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f54.google.com (mail-oo1-f54.google.com [209.85.161.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 16 Jun 2020 00:37:14 -0700 (PDT) Received: by mail-oo1-f54.google.com with SMTP id z145so3889587ooa.13 for ; Tue, 16 Jun 2020 00:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4U97Tr2FgNO7tPfgbTlT2ZNFGVLh5TxH8XprYlRDp3M=; b=YTqitRhozF3D8D+7pDnlRBV0KR30fxXJY6pmNi96owCVEDY3BB+eH9TRn/0Y0Mz0uA j0wGzcUzrnlN78jVVgkGILSiw8phTQlLkhd2EfYCDq7vheo0JPXMD/992Jsg8/nMPKV4 Yqm6DSe7y8RLV0aVFxIHQgpaWdEcFeI5CvGagT7LS4odOAW0treIBHBKeGC744J+JGra D0yNcNUDnuPQkYUCu7nArrD6Tu23CJGeeBOLyjbqQ+8HaJlrRN/TKkercrPIbUi7OqMp DmSHSjlEi42X5KQHtENfv8/76hXZyMQtFYjnopymbYJzEGx3bGF34mmFbqvVE1MIf1sr dHPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4U97Tr2FgNO7tPfgbTlT2ZNFGVLh5TxH8XprYlRDp3M=; b=ofjMq5GjFwa+T1z8jRX6v/BqYyFCsFK12DIxpWTkv856yZk0Lv6Cu9ble3B5pC+EIQ 9u6zIJXLFwq9p8elTFno5N5KFgnm3wp7OAaO+W5kXguB0sMB25D7iBtGwdtvOlOAGRcI C+PaOOM2eAQ7gTRBIlMLcQ/Eck/3jaQazOf/HVosTjIEe1hsycxixaMnF6HQ3UVFidY1 00RVglCrX8BXBZWrjBdu7rZa7GyHIcXVlbwEDdUjs5LTl8xW+8hV/IfQEAY9twYPisdc 6vHdWDH3Xu+q6d6JL2UqEl14z2Mn6XT/Kz10vIic9fWCv+aI29kO0L1433t5HXbGZcS6 u8/Q== X-Gm-Message-State: AOAM53000wFYDrjgMpMn7a2fRVOniML7/XoJHx2hEzrI40NQ2XeKx7v+ 9no6yLL8vpRi9rCs+Y4xVyF1m4AOs02gEfWXs5Q= X-Google-Smtp-Source: ABdhPJyB4+edfJOgi5RAHYmQmkTj+aX8935po5HoZ1MGazqvVMgDOd0FMXvd3oZzNCM/3rWr7+7g84b9/+jndUo5YBI= X-Received: by 2002:a4a:4904:: with SMTP id z4mr1269682ooa.63.1592293032223; Tue, 16 Jun 2020 00:37:12 -0700 (PDT) MIME-Version: 1.0 References: <9D1E1E08-7DD5-4FD3-B08E-58254CC75FC5@newclarity.net> In-Reply-To: <9D1E1E08-7DD5-4FD3-B08E-58254CC75FC5@newclarity.net> Date: Tue, 16 Jun 2020 09:37:01 +0200 Message-ID: To: Mike Schinkel Cc: PHP internals Content-Type: multipart/alternative; boundary="00000000000090697605a82e9c5f" Subject: Re: [PHP-DEV] Remove LSP checks on static methods? From: michal.brzuchalski@gmail.com (=?UTF-8?Q?Micha=C5=82_Brzuchalski?=) --00000000000090697605a82e9c5f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Mike, wt., 16 cze 2020 o 08:59 Mike Schinkel napisa=C5=82(a= ): > Hi internals, > > Given that there appears to be some appetite to reduce checks for > inappropriate signatures[1] I am wondering if anyone has strong opinions = =E2=80=94 > pro or con =E2=80=94 on removing checks for static methods? > > My primary use-case where I would like to see checked relaxed is for > static methods used as factory methods[2]. > > Per [3] it seems that all but the least upvoted answer argues that LSP > applies to instances, not static methods. > > Per [4] it seems that all upvoted answers agree that constructors should > not be constrained by LSP, and since a factory method is a form of a > constructor it would seem that if constructors do not require LSP then > factory methods would not either. > > Does anyone see any issues with relaxing these checks for static methods > that would have them downvote an RFC on the topic? > I can only see a one huge BC break. What you suggest would require the deprecation of static methods on interfaces. Currently, you can declare a static method on an interface, like this: interface Foo { public static function create(): self; } class Bar implements Foo { public static function create(): self { return new self(); } } var_dump(Bar::create()); Hence it'll be a huge BC break and the first reason downvote to the RFC I guess. Cheers, Micha=C5=82 Marcin Brzuchalski --00000000000090697605a82e9c5f--