Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/Zend/Mobile/Push/ApnsFeedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

$tokens = $apns->feedback();
while(list($token, $time) = each($tokens)) {
foreach ($tokens as $token => $time) {
echo $time . "\t" . $token . PHP_EOL;
}
$apns->close();
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ try {
}

$tokens = $apns->feedback();
while(list($token, $time) = each($tokens)) {
foreach ($tokens as $token => $time) {
echo $time . "\t" . $token . PHP_EOL;
}
$apns->close();
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Cache/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Zend_Cache_Backend
*/
public function __construct(array $options = array())
{
while (list($name, $value) = each($options)) {
foreach ($options as $name => $value) {
$this->setOption($name, $value);
}
}
Expand All @@ -76,7 +76,7 @@ public function __construct(array $options = array())
public function setDirectives($directives)
{
if (!is_array($directives)) Zend_Cache::throwException('Directives parameter must be an array');
while (list($name, $value) = each($directives)) {
foreach ($directives as $name => $value) {
if (!is_string($name)) {
Zend_Cache::throwException("Incorrect option name : $name");
}
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Cache/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function __construct($options = array())
Zend_Cache::throwException("Options passed were not an array"
. " or Zend_Config instance.");
}
while (list($name, $value) = each($options)) {
foreach ($options as $name => $value) {
$this->setOption($name, $value);
}
$this->_loggerSanity();
Expand All @@ -158,7 +158,7 @@ public function __construct($options = array())
public function setConfig(Zend_Config $config)
{
$options = $config->toArray();
while (list($name, $value) = each($options)) {
foreach ($options as $name => $value) {
$this->setOption($name, $value);
}
return $this;
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cache/Frontend/Class.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Zend_Cache_Frontend_Class extends Zend_Cache_Core
*/
public function __construct(array $options = array())
{
while (list($name, $value) = each($options)) {
foreach ($options as $name => $value) {
$this->setOption($name, $value);
}
if ($this->_specificOptions['cached_entity'] === null) {
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cache/Frontend/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class Zend_Cache_Frontend_File extends Zend_Cache_Core
*/
public function __construct(array $options = array())
{
while (list($name, $value) = each($options)) {
foreach ($options as $name => $value) {
$this->setOption($name, $value);
}
if (!isset($this->_specificOptions['master_files'])) {
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cache/Frontend/Function.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Zend_Cache_Frontend_Function extends Zend_Cache_Core
*/
public function __construct(array $options = array())
{
while (list($name, $value) = each($options)) {
foreach ($options as $name => $value) {
$this->setOption($name, $value);
}
$this->setOption('automatic_serialization', true);
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Cache/Frontend/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Zend_Cache_Frontend_Page extends Zend_Cache_Core
*/
public function __construct(array $options = array())
{
while (list($name, $value) = each($options)) {
foreach ($options as $name => $value) {
$name = strtolower($name);
switch ($name) {
case 'regexps':
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Config/Yaml.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ protected static function _decodeYaml($currentIndent, &$lines)
{
$config = array();
$inIndent = false;
while (list($n, $line) = each($lines)) {
foreach ($lines as $n => $line) {
$lineno = $n + 1;

$line = rtrim(preg_replace("/#.*$/", "", $line));
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Db/Table/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ protected function _setupTableName()
*/
protected function _setupMetadata()
{
if ($this->metadataCacheInClass() && (count($this->_metadata) > 0)) {
if ($this->metadataCacheInClass() && (is_array($this->_metadata) && count($this->_metadata) > 0)) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function getAllCapabilities(TeraWurfl $wurflObj)
if (!is_array($group)) {
continue;
}
while (list ($key, $value) = each($group)) {
foreach ($group as $key => $value) {
if (is_bool($value)) {
// to have the same type than the official WURFL API
$features[$key] = ($value ? 'true' : 'false');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function __construct(array $options = array())
{
$this->_credential = new Zend_Service_DeveloperGarden_Credential();

while (list($name, $value) = each($options)) {
foreach ($options as $name => $value) {
switch (ucfirst($name)) {
case 'Username' :
$this->_credential->setUsername($value);
Expand Down
10 changes: 8 additions & 2 deletions library/Zend/XmlRpc/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,19 @@ protected static function _createSimpleXMLElement(&$xml)
*/
protected static function _extractTypeAndValue(SimpleXMLElement $xml, &$type, &$value)
{
list($type, $value) = each($xml);
// hack to work around each() deprecation in php 7.2
$type = key($xml);
$value = current($xml);
next($xml); // finally, advance cursor similar to each()

if (!$type and $value === null) {
$namespaces = array('ex' => 'http://ws.apache.org/xmlrpc/namespaces/extensions');
foreach ($namespaces as $namespaceName => $namespaceUri) {
$namespaceXml = $xml->children($namespaceUri);
list($type, $value) = each($namespaceXml);
// hack to work around each() deprecation in php 7.2
$type = key($namespaceXml);
$value = current($namespaceXml);
next($namespaceXml); // finally, advance cursor similar to each()
if ($type !== null) {
$type = $namespaceName . ':' . $type;
break;
Expand Down
12 changes: 10 additions & 2 deletions tests/Zend/Service/Technorati/TechnoratiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,11 @@ private function _testOption($validOptions, $xmlFile, $callbackMethod, $callback
{
$technorati = $this->_setResponseFromFile($xmlFile);
foreach ($validOptions as $pair) {
list($option, $value) = each($pair);
// deprecated; list($option, $value) = each($pair);
// hack to work around each() deprecation in php 7.2
$option = key($pair);
$value = current($pair);
next($pair); // finally, advance cursor similar to each()
$options = is_array($callbackRequiredOptions) ?
array_merge($callbackRequiredOptions, array($pair)) :
array($pair);
Expand All @@ -593,7 +597,11 @@ private function _testThrowsExceptionWithInvalidOption($invalidOptions, $xmlFile
{
$technorati = $this->_setResponseFromFile($xmlFile);
foreach ($invalidOptions as $pair) {
list($option, $value) = each($pair);
// deprecated; list($option, $value) = each($pair);
// hack to work around each() deprecation in php 7.2
$option = key($pair);
$value = current($pair);
next($pair); // finally, advance cursor similar to each()
$options = is_array($callbackRequiredOptions) ?
array_merge($callbackRequiredOptions, array($pair)) :
array($pair);
Expand Down
4 changes: 2 additions & 2 deletions tests/Zend/XmlRpc/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,14 @@ protected function _testXmlRequest($xml, $argv)

$result = $sx->xpath('//methodName');
$count = 0;
while (list( , $node) = each($result)) {
foreach ($result as $node) {
++$count;
}
$this->assertEquals(1, $count, $xml);

$result = $sx->xpath('//params');
$count = 0;
while (list( , $node) = each($result)) {
foreach ($result as $node) {
++$count;
}
$this->assertEquals(1, $count, $xml);
Expand Down
2 changes: 1 addition & 1 deletion tests/runalltests.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
$result = 0;

// run through phpunit
while(list(, $file)=each($files)) {
foreach ($files as $file) {
if ($_SERVER['TRAVIS_PHP_VERSION'] == 'hhvm' && $file == 'Zend/CodeGenerator/AllTests.php') {
echo "Skipping $file on HHVM" . PHP_EOL; //gets stuck on the HHVM
continue;
Expand Down