Skip to content
Snippets Groups Projects
Commit 6c28abd3 authored by Miniontoby's avatar Miniontoby :writing_hand_tone1:
Browse files

Removed the temp function

parent fc18c689
No related branches found
No related tags found
No related merge requests found
......@@ -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 ***
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment