버그 수정

This commit is contained in:
2019-04-21 22:29:08 +09:00
parent a31c949734
commit dd81dcc9c6
12 changed files with 104 additions and 66 deletions
+13 -7
View File
@@ -297,25 +297,31 @@ class Util extends \utilphp\util
return $result;
}
public static function isDict(&$array)
public static function isDict($array)
{
if($array === null){
return false;
}
if (!is_array($array)) {
//배열이 아니면 dictionary 조차 아님.
return false;
}
if(count($array) === 0){
return true;
}
$idx = 0;
$jmp = 0;
foreach ($array as $key=>$value) {
foreach (array_keys($array) as $key) {
if (is_string($key)) {
return true;
}
if(!$idx + 1 == $key){
return false;
if($idx !== $key){
return true;
}
$idx = $key;
$idx = $key + 1;
}
return true;
return false;
}
/**