修訂 | b967625ebec73e4cc09e984c2425ee68e6b56330 (tree) |
---|---|
時間 | 2018-01-16 10:31:24 |
作者 | naoki hirata <naoki@magi...> |
Commiter | naoki hirata |
カレンダーライブラリ修正。
@@ -405,13 +405,24 @@ class Calendar | ||
405 | 405 | */ |
406 | 406 | function fetch() |
407 | 407 | { |
408 | - $child = each($this->children); | |
408 | +/* $child = each($this->children); | |
409 | 409 | if ($child) { |
410 | 410 | return $child['value']; |
411 | 411 | } else { |
412 | 412 | reset($this->children); |
413 | 413 | return false; |
414 | 414 | } |
415 | + */ | |
416 | + // PHP7.2非奨励のeach()を置き換え | |
417 | + $key = key($this->children); | |
418 | + if ($key){ | |
419 | + $value = $this->children[$key]; | |
420 | + next($this->children); | |
421 | + return $value; | |
422 | + } else { | |
423 | + reset($this->children); | |
424 | + return false; | |
425 | + } | |
415 | 426 | } |
416 | 427 | |
417 | 428 | /** |