call Z_ADDREF_P before appending to array