I need to push a new object into an array when it doesn't exist in the array. but I keep receiving this error. I read this often occurs when creating new objects in a loop or pushing items onto an array in a loop. I've attempted to reuse the objects and just reset the member values but I still get the same errors. What is the best way to accomplish this?
Error:
PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes)
Code:
if(!array_key_exists($a->name, $tArray)) $tArray[] = $a;