Re: Typed array properties V2

From: Date: Sun, 19 Apr 2020 22:53:26 +0000
Subject: Re: Typed array properties V2
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-109709@lists.php.net to get a copy of this message
Yes! Though I don't necessarily think they need to be genericised (e.g. list<int>) in the language itself – just having those alternate datatypes would, I think, be a boon to the language itself – with list (a subtype of array) more useful to me than dict. On Sat, 18 Apr 2020 at 10:51, Sebastian Bergmann <sebastian@php.net> wrote: > Am 21.01.2020 um 22:21 schrieb Matthew Brown: > > What if we left the array type alone, and instead focussed on "list<Foo>" > > type and "dict<string, Foo>", "dict<int, Bar>" types? > > > > That would allow a clear break from previous behaviour, and would allow > you > > to introduce other changes (e.g. removing string -> int coercion for > > numeric string keys). > > Just to make sure I understand you correctly: are you proposing new data > structures, names list and dict, in addition to array that can bring more > specific / strict semantics? > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.internals (#109709) next »