Re: [RFC][VOTE] Allow specifying keys in list()

From: Date: Fri, 12 Feb 2016 15:21:20 +0000
Subject: Re: [RFC][VOTE] Allow specifying keys in list()
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-91225@lists.php.net to get a copy of this message
2016-02-12 17:15 GMT+02:00 Rowan Collins <rowan.collins@gmail.com>: > S.A.N wrote on 12/02/2016 15:13: >> >> But is also necessary and the function or operator like >> object_assign($target, ...$sources) > > > Like I say, for that kind of purpose, I'd just use an array, which already > has the facilities for working with arbitrary keys. But I know some people > think $foo->bar "looks prettier" than $foo['bar'], and make big trees of > stdClass objects, so maybe it's a matter of taste. It's not just a matter of taste, the object is always passed by reference, an array is copied when you change, object literal syntax like JSON, sorely lacking in PHP. Probably more correct to focus on the implementation of object literal syntax. Thank.

« previous php.internals (#91225) next »