> On Sep 2, 2020, at 6:27 AM, Dik Takken <dik.tak...@gmail.com> wrote:
> 
> On 02-09-2020 12:48, Olle Härstedt wrote:
>> An alternative syntax would be
>> 
>>    foreach($iterable as $key => _) { ... }
>> 
>> Using underscore as a way to signal "I don't care about this value".
>> Same could be possible with list destructoring, like
>> 
>>    [_, _, $something] = foo();
>> 

Swift also uses the underscore in places. 

>> 1. It is currently a valid constant name (BC break)

I can name a constant an underscore??

Does anyone actually do this??

I guess I’m asking how impactful the break would be considering most magic 
things start with double underscore and I haven’t seen many people using the 
single underscore to represent instance variables anymore.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to