I don't understand, because if array is not empty, first element always exists, or maybe I missing something?
http://codepad.org/Zxj4pQv5

Yes, I need to remove this line, because it is not neccessary.