Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

PHP-function each() has been deprecated (ZF2) #7777

Open
alexgit2k opened this issue Dec 5, 2017 · 0 comments
Open

PHP-function each() has been deprecated (ZF2) #7777

alexgit2k opened this issue Dec 5, 2017 · 0 comments

Comments

@alexgit2k
Copy link

The PHP-function each() has been deprecated as of PHP 7.2.0 (https://wiki.php.net/rfc/deprecations_php_7_2#each), but is still used in ZF 2.4:

library/Zend/XmlRpc/AbstractValue.php: list($type, $value) = each($xmlAsArray);
library/Zend/XmlRpc/AbstractValue.php: list($type, $value) = each($namespaceXml);

tests/ZendTest/Db/Sql/Platform/Mysql/MysqlTest.php: list($type, $decorator) = each($decorators);
tests/ZendTest/Db/Sql/Platform/SqlServer/SqlServerTest.php: list($type, $decorator) = each($decorators);
tests/ZendTest/Form/View/Helper/FormSelectTest.php: list($value, $label) = each($options);
tests/ZendTest/ServiceManager/TestAsset/FooInitializer.php: list($key, $value) = each($this->var);
tests/ZendTest/XmlRpc/RequestTest.php: while (list(, $node) = each($result)) {
tests/ZendTest/XmlRpc/RequestTest.php: while (list(, $node) = each($result)) {

So each() should be replaced by foreach() which is also 10 times faster.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant