Question: what is undefined offset in php?
Answer: An offset is undefined if it doesn't exist in the array. The notice is thrown the first time you reference the element, then PHP initializes the element and sets it to NULL.