I brought this up on another thread, but it wasn't addressed (which is
fine, since it was somewhat off-topic). I thought it might be
worth bringing up in its own thread, though.
In the other thread, someone had mentioned the following compiler
optimization
foreach(\array_keys($arr) as $key) {
and quietly transform that into:
foreach ($arr as $key => $_unusedVariableNameThatIsntEvenSpilledToTheScope)
{
I would be more likely to write:
$keys = array_keys($arr);
foreach($keys as $key){
Which would prevent me from being able to take advantage of the
optimization.
So, what I was wondering, is if there are other optimizations I might be
missing out on, and if so, are they documented anywhere?
--
Chase Peeler
[email protected]