summaryrefslogtreecommitdiffstats
path: root/6018b26b20a78654c113da04ad9e816b1ac0c5e9.patch
blob: 5a928e1027a38a1a8682a175d448fca43c032eab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
From 6018b26b20a78654c113da04ad9e816b1ac0c5e9 Mon Sep 17 00:00:00 2001
From: Jan Schneider <jan@horde.org>
Date: Mon, 13 Feb 2017 14:57:35 +0100
Subject: [PATCH] Don't use each().

For modern PHP versions there is no improved performance or memory usage compared to foreach() anymore. Beside that it's deprecated in PHP 7.2.
---
 lib/Horde/Stream/Wrapper/Combine.php | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/Horde/Stream/Wrapper/Combine.php b/lib/Horde/Stream/Wrapper/Combine.php
index 309d705..167f368 100644
--- a/lib/Horde/Stream/Wrapper/Combine.php
+++ b/lib/Horde/Stream/Wrapper/Combine.php
@@ -125,8 +125,7 @@ public function stream_open($path, $mode, $options, &$opened_path)
             throw new Exception('Use ' . __CLASS__ . '::getStream() to initialize the stream.');
         }
 
-        reset($data);
-        while (list(,$val) = each($data)) {
+        foreach ($data as $val) {
             if (is_string($val)) {
                 $fp = fopen('php://temp', 'r+');
                 fwrite($fp, $val);