Commit: 38212625bd3c4356c1173c0ef4fd3af76f404fb5 Author: Peter Kokot <peterko...@gmail.com> Sat, 24 Nov 2018 02:25:23 +0100 Parents: 0818111ce98a81dcf40ec23c7707ae7804443567 Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=38212625bd3c4356c1173c0ef4fd3af76f404fb5 Log: Refactor each() function to foreach() The each() function has been deprecated since PHP 7.2 and shouldn't be used anymore: - http://php.net/manual/en/function.each.php Changed paths: M include/functions.php Diff: diff --git a/include/functions.php b/include/functions.php index 13b9c64..cb6d6aa 100644 --- a/include/functions.php +++ b/include/functions.php @@ -498,7 +498,7 @@ function show_byage_options($current) '30' => '30 days ago', '90' => '90 days ago', ]; - while (list($k,$v) = each($opts)) { + foreach ($opts as $k => $v) { echo "<option value=\"$k\"", ($current==$k ? ' selected="selected"' : ''), ">$v</option>\n"; } } @@ -784,7 +784,7 @@ function show_package_options($current, $show_any, $default = '') function show_boolean_options($current) { $options = ['any', 'all', 'raw']; - while (list($val, $type) = each($options)) { + foreach ($options as $val => $type) { echo '<input type="radio" name="boolean" value="', $val, '"'; if ($val === $current) { echo ' checked="checked"'; -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php