I am using phpdocx to generate an array with my data in a docx format. $contact is an array of multiple object. Sometimes $contact contain 1 object, and sometimes more. I want to make a loop, to add contact as much as I need. My problem : For exemple, If I am doing this I will get an error like