Use array_lengthof instead of manually calculating it. NFC