On Thu, Apr 23, 2020 at 8:16 AM Matthew Brown <matthewmatt...@gmail.com> wrote:
>>
>> IIRC, they switched from object semantics to value semantics (like PHP
>> arrays). Can someone more knowledgeable confirm?
>
>
> Yes, sorry – Hack introduced the vec type (with value semantics) in 2016 
> after they'd experimented first with Vector (object semantics). Use of Vector 
> is now discouraged.
>
> Details here: https://github.com/facebook/hhvm/issues/6451
>
> FB/Hack appears to be in the multi-year process of moving all PHP arrays to 
> one of [vec/dict/keyset]. That's likely not an option for PHP itself, but 
> having the _option_ of a vec equivalent (in this proposal "list") would make 
> sense, I think.

Yeah, I already figured that value semantics would be preferred for
this. From the engine perspective, we probably wouldn't want to
special case these 3 types and would probably want to figure out some
way for at least internal classes to have value semantics. Any
contrarian opinions there, especially from main php-src contributors
like Nikita and Dmitry?

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to