Hey Everyone,
I was looking through a script we have on the local environment and it contains a global.
What the script does is checking if the user is already in the $GLOBALS['cceLeadList']
. If not it will be added to the Global. Else it would skip the script.
$GLOBALS['cceLeadList'][] = $this->getLeadInfo($lead, 'email');
}
public function didAlreadyAddAttachement($leadEmail)
{
if (!isset($GLOBALS['cceLeadList'])) {
$GLOBALS['cceLeadList'] = [];
}
if (array_search($leadEmail, $GLOBALS['cceLeadList'])) {
return true;
}
return false;
}
Now I am wondering where the global is stored. Let say the file is called multiple times. Would the global get emptied every time?