Re: Any interest in a list type?

From: Date: Thu, 23 Apr 2020 14:19:32 +0000
Subject: Re: Any interest in a list type?
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-109814@lists.php.net to get a copy of this message
On Thu, Apr 23, 2020 at 8:16 AM Matthew Brown <matthewmatthew@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?

« previous php.internals (#109814) next »