Re: [RFC][Draft] Sealed Classes

From: Date: Mon, 26 Apr 2021 07:35:33 +0000
Subject: Re: [RFC][Draft] Sealed Classes
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-114177@lists.php.net to get a copy of this message
2021-04-26 9:22 GMT+02:00, Pierre <pierre-php@processus.org>: > 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)? Olle

« previous php.internals (#114177) next »