diff --git a/inc/JpegMeta.php b/inc/JpegMeta.php
index ca59eb05fa5378b32e8c7c6b63f36f5c1f83b554..d667ce303d88dd53fb429d6edc3f28412a6e90f0 100644
--- a/inc/JpegMeta.php
+++ b/inc/JpegMeta.php
@@ -2037,8 +2037,7 @@ class JpegMeta {
         $ifdEntries = array();
         $entryCount = 0;
 
-        reset($EXIFNames);
-        while (list($tag, $name) = each($EXIFNames)) {
+        foreach($EXIFNames as $tag => $name) {
             $type = $EXIFTypeInfo[$tag][0];
             $count = $EXIFTypeInfo[$tag][1];
             $value = null;
@@ -2578,9 +2577,7 @@ class JpegMeta {
 
         $IPTCNames =& $this->_iptcNameTags();
 
-        reset($this->_info['iptc']);
-
-        while (list($label) = each($this->_info['iptc'])) {
+        foreach($this->_info['iptc'] as $label => $value) {
             $value =& $this->_info['iptc'][$label];
             $type = -1;
 
@@ -2969,8 +2966,8 @@ class JpegMeta {
     /*************************************************************/
     function _names2Tags($tags2Names) {
         $names2Tags = array();
-        reset($tags2Names);
-        while (list($tag, $name) = each($tags2Names)) {
+
+        foreach($tags2Names as $tag => $name) {
             $names2Tags[$name] = $tag;
         }
 
diff --git a/inc/feedcreator.class.php b/inc/feedcreator.class.php
index fe444b39baa3b750026d35ca57afe9b760bf8e10..926bdc8dbe1faf06a41c70288a91baa719a7edd3 100644
--- a/inc/feedcreator.class.php
+++ b/inc/feedcreator.class.php
@@ -1315,7 +1315,7 @@ class MBOXCreator extends FeedCreator {
         $eol = "\r\n";
         $escape = "=";
         $output = "";
-        while( list(, $line) = each($lines) ) {
+        foreach($lines as $line) {
             //$line = rtrim($line); // remove trailing white space -> no =20\r\n necessary
             $linlen = strlen($line);
             $newline = "";
diff --git a/inc/html.php b/inc/html.php
index 70ba4dcfe55fe55364b93c7c783cee8b11058a61..2897d01c15e3f07bb99df75f3a279b57e773b90b 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -208,8 +208,7 @@ function html_btn($name, $id, $akey, $params, $method='get', $tooltip='', $label
     $ret .= '<form class="button btn_'.$name.'" method="'.$method.'" action="'.$script.'"><div class="no">';
 
     if(is_array($params)){
-        reset($params);
-        while (list($key, $val) = each($params)) {
+        foreach($params as $key => $val) {
             $ret .= '<input type="hidden" name="'.$key.'" ';
             $ret .= 'value="'.htmlspecialchars($val).'" />';
         }
diff --git a/inc/parser/handler.php b/inc/parser/handler.php
index 02d2e66894afc467519d5f8c801461f2ef4f28f3..e31bf05cdd3e2ff6730fe9fd4c283d1c209fa86b 100644
--- a/inc/parser/handler.php
+++ b/inc/parser/handler.php
@@ -57,10 +57,16 @@ class Doku_Handler {
         array_push($this->calls,array('document_end',array(),$last_call[2]));
     }
 
+    /**
+     * fetch the current call and advance the pointer to the next one
+     *
+     * @return bool|mixed
+     */
     function fetch() {
-        $call = each($this->calls);
-        if ( $call ) {
-            return $call['value'];
+        $call = current($this->calls);
+        if($call !== false) {
+            next($this->calls); //advance the pointer
+            return $call;
         }
         return false;
     }