Deprecated each() function in php 7.2

This commit is contained in:
Yuriy Pikhtarev 2017-02-26 01:44:28 +03:00
commit 3d817078a6
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
15 changed files with 49 additions and 45 deletions

View file

@ -1028,13 +1028,13 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false)
if (!is_array($default)) {
$type = gettype($default);
} else {
list($key_type, $type) = each($default);
list($key_type, $type) = $default;
$type = gettype($type);
$key_type = gettype($key_type);
if ($type == 'array') {
reset($default);
$default = current($default);
list($sub_key_type, $sub_type) = each($default);
list($sub_key_type, $sub_type) = $default;
$sub_type = gettype($sub_type);
$sub_type = ($sub_type == 'array') ? 'NULL' : $sub_type;
$sub_key_type = gettype($sub_key_type);