Re: RFC - Array slice syntactic sugar

From: Date: Fri, 20 Mar 2015 23:28:08 +0000
Subject: Re: RFC - Array slice syntactic sugar
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-85350@lists.php.net to get a copy of this message
Hi! > Implementation is not something I have looked into for this yet, so I am > unsure how this would be possible; but by passing $array[*1:4], you'd be > passing an extracted array which is a reference to the original array. > Such that changing the sub array can change the parent array. Exactly. This means you can not make $array[*1:4] a real lvalue, which means you instead need to make it some kind of a hack on case-by-case basis, at which point it's no better than array_splice only implemented in more complicated way. -- Stas Malyshev smalyshev@gmail.com

« previous php.internals (#85350) next »