From 6c28abd37dfa068a82bf3a177aa6f5ca2557b262 Mon Sep 17 00:00:00 2001 From: Miniontoby <tobias.gaarenstroom@gmail.com> Date: Fri, 16 Feb 2024 16:54:41 +0100 Subject: [PATCH] Removed the temp function --- functions/basic.php | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/functions/basic.php b/functions/basic.php index cb548c2..22653da 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 *** -- GitLab