Re: [VOTE] Reserve even more type hints

From: Date: Mon, 16 Mar 2015 23:49:31 +0000
Subject: Re: [VOTE] Reserve even more type hints
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-85107@lists.php.net to get a copy of this message
On Mon, Mar 16, 2015 at 7:37 PM, Dan Ackroyd <danack@basereality.com> wrote: > On 16 March 2015 at 06:44, Sara Golemon <pollita@php.net> wrote: >> The voting period for the "Even More" type hints reservation RFC is now open. >> > > There's been a little bit of traffic on the list in the past few days; > I don't think your RFC has received enough cogent discussion. > I can't force people to talk about something. Especially something so minor while the war-of-the-century is being waged. > In particular the keywords 'Resource' and 'mixed' seem to have limited > need to be reserved. I don't believe there has been any suggestion > that either of these would actually be used as types for PHP 7.x. So > making them be unusable seems to be a large BC hit for no gain for > people who currently have classes that use them > To be clear, this RFC is about declaring these names as reserved, not about actually /using/ them. There's no language in the RFC about actually throwing errors or other code-breaking behavior. Therefore, even should all of them pass, it does *NOT* mean that your code using these names suddenly stops working on PHP7. It means that you have been warned that using the names of intrinsics is a bad idea, and that the language reserves the /right/ to make doing so an error at some point in the future. > Can anyone please make a strong argument for why 'resource' and > 'mixed' should be reserved, if we currently have no plans to use them? > In the case of "resource", because it refers to a real type in PHP's type system. Using that intrinsic as an arbitrary label is a bad idea. It'd be like putting your project's code in the PHP namespace. There's nothing in the language preventing you from doing so, but it's a bad idea. Formalizing that it's a bad idea is what this RFC does. As far as "mixed"... I don't have a strong reason for it. TBQH, I'm not strongly in favor of all of these supplemental types. but they're included for completeness, and presented as individual voting options for flexibility. -Sara

« previous php.internals (#85107) next »