current() VS list() on each()

32 views Asked by At

I'm trying to get rid of deprecated code on a PHP7.2 web server by replacing the following code:

list(, $block) = each($this->blocks);

with that:

$block = current($this->_blocks);

I am not expecting any differences. Tests on simple arrays return the same results. Can anyone sees how it could be a problem ?

0

There are 0 answers