Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114178 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 8496 invoked from network); 26 Apr 2021 07:34:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 26 Apr 2021 07:34:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F0E291804BD for ; Mon, 26 Apr 2021 00:38:00 -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=-1.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from processus.org (ns366368.ip-94-23-14.eu [94.23.14.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 26 Apr 2021 00:38:00 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by processus.org (Postfix) with ESMTPA id 335985101324 for ; Mon, 26 Apr 2021 07:37:59 +0000 (UTC) To: internals@lists.php.net References: <5b9f1500-615a-48f1-815f-1d48b327ef90@processus.org> <179049b1475.11134368b213512.254739612773841999@void.tn> <0BF84585-DDC3-4B25-BFD2-D8B916D135EE@newclarity.net> <015f6acb-eece-93c4-fd0e-0b54acd7170e@processus.org> Message-ID: Date: Mon, 26 Apr 2021 09:37:58 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Authentication-Results: processus.org; auth=pass smtp.auth=pierre-php@processus.org smtp.mailfrom=pierre-php@processus.org X-Spamd-Bar: / Subject: Re: [PHP-DEV] [RFC][Draft] Sealed Classes From: pierre-php@processus.org (Pierre) Le 26/04/2021 à 09:35, Olle Härstedt a écrit : > 2021-04-26 9:22 GMT+02:00, Pierre : >> Le 25/04/2021 à 21:22, Larry Garfield a écrit : >>> Stitching together 2 replies to minimize thread noise... >>> >>> On Sun, Apr 25, 2021, at 11:58 AM, Michał Marcin Brzuchalski wrote: >>> >>>> Speaking of Attributes I prefer not to use an Attribute for any >>>> particular >>>> language feature which expects input arguments to be a valid class or >>>> interface name for two reasons: first because there is no effective way >>>> to >>>> restrict input string to be a valid class or interface name and second >>>> that >>>> it'd require passing strings which means in most cases passing class or >>>> interface name with magic ::class constant read. >>>> >>>> Cheers, >>>> Michał Marcin Brzuchalski >>> That's actually a pretty solid argument against attributes here, honestly. >>> Consider me convinced, and now in favor of "final class Foo permits Bar, >>> Baz". :-) >>> >> Yes, even though I was the first mail suggesting it in the beginning, >> this is a solid argument which actually do change my mind. >> >> In the end, I like the `class Foo permis Bar, Baz` syntax, with a single >> keyword added. >> >> -- >> >> Pierre >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: https://www.php.net/unsub.php >> >> > Is there actually a bug that this functionality can/could prevent? I > get that Maybe and Result types should be closed, but what are the > risk of software defects if someone abuses that fact (locally)? I don't know if you replied to the right mail, I should have specified I was talking about using an attribute versus adding a new keyword to the language. -- Pierre