|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-06-09 16:02 UTC] mike@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 10:00:01 2025 UTC |
Description: ------------ When i make a for in a array associative, but using some wrong key like numeric, this crash the system. Please see the code Reproduce code: --------------- protected function getArray() { $days = array(); for ($i = 31; $i > 0; $i--) { $day = mktime (0, 0, 0, date("m") , date("d")-$i, date("Y")); if (date('w', $day) != 0 && date('w', $day) != 6 ){ $days[] = date('d/m/Y', $day); } } $days = array_flip($days); for ($i = 0; $i < count($days); $i++) { //Here is the problem, becouse insted of use a correct key, i use a number. In this point the system crash. $days[$i] = 0; } return $days; }