diff --git a/functions/basic.php b/functions/basic.php index cb548c2a57c73d5e131060f3cb1b79548cb58dc9..22653da498ecb714fbb304d591a043590efe5ce8 100644 --- a/functions/basic.php +++ b/functions/basic.php @@ -9,42 +9,6 @@ function set_method_variable_value($method, array $array = []): void { } set_method_variable_value($_SERVER, ['PHP_AUTH_USER', 'PHP_AUTH_PW', 'REMOTE_HOST', 'REMOTE_ADDR', 'REQUEST_URI']); -if (!function_exists('each')) { // this is when php8.0 since each has been DEPRECATED as of PHP 7.2.0, and REMOVED as of PHP 8.0.0. Relying on this function is highly discouraged. - /* - so you should replace the functions - - while( |)\(list\((\$\w+),( |)(\$\w+)\) = each\((\$\w+)\)\)( |)\{ - foreach (\5 as \2 => \4) { - - - while( |)\(list\(,( |)(\$\w+)\) = each\((\$\w+)\)\)( |)\{ - foreach (\4 as \3) { - - - while( |)\(list\((\$\w+)( |),\) = each\((\$\w+)\)\)( |)\{ - foreach (array_keys(\4) as \2) { - */ - $usage = []; - function each(&$array) { - global $usage; - $id = md5(serialize($array)); - if (!in_array($id, $usage)) { - array_push($usage, $id); - echo "Legacy each used!"; - } - $key = key($array); - $value = current($array); - $each = is_null($key) ? false : [ - 1 => $value, - 'value' => $value, - 0 => $key, - 'key' => $key, - ]; - next($array); - return $each; - } -} - /* ******************************************************** *** This script from MySQL/PHP Database Applications ***