Skip to content
This repository was archived by the owner on May 16, 2018. It is now read-only.

PHP-functions each() and create_function() have been deprecatedΒ #747

@alexgit2k

Description

@alexgit2k

The PHP-functions each() and create_function() have been deprecated as of PHP 7.2.0, but are still used in ZF1:

demos/Zend/Mobile/Push/ApnsFeedback.php: while(list($token, $time) = each($tokens)) {

documentation/manual/en/module_specs/Zend_Mobile_Push-Apns.xml:while(list($token, $time) = each($tokens)) {

library/Zend/Cache/Backend.php: while (list($name, $value) = each($directives)) {
library/Zend/Config/Yaml.php: while (list($n, $line) = each($lines)) {
library/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php: while (list ($key, $value) = each($group)) {
library/Zend/XmlRpc/Value.php: list($type, $value) = each($xml);
library/Zend/XmlRpc/Value.php: list($type, $value) = each($namespaceXml);

tests/Zend/XmlRpc/RequestTest.php: while (list( , $node) = each($result)) {
tests/Zend/XmlRpc/RequestTest.php: while (list( , $node) = each($result)) {
tests/runalltests.php: while(list(, $file)=each($files)) {

So each() should be replaced by foreach() which is also 10 times faster or key()/current()/next().

library/Zend/Feed/Element.php: return array_map(create_function('$e', 'return new Zend_Feed_Element($e);'), $nodes);

Note

As ZF1 reached its End of Life, please note it here, if you forked ZF1 with PHP 7.2 Support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions