2016-02-12 17:15 GMT+02:00 Rowan Collins <rowan.coll...@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. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php