This answer helped me https://stackoverflow.com/a/18880670/1821607
The reason of crush — index 0 wasn't set. Simple $array = $array + array(null)
did the trick. Or you should check whether array element on index 0 is set via isset($array[0])
. The second variant is the best approach for me.