I am writing a function that returns an array of values to the caller. Let's say the array is:
$arr['keyN'] = $valueN;
If any '$keyN' does not have a value; its value is entered as zero.
My question is purely from a performance point of view: Is it better to give the key a value of zero or to NOT GIVE IT ANY VALUE AT ALL and have the caller test its presence if(isset($arr[$keyN]))....then execute code?
The reason I am asking this is because giving the array key a zero value will consume main memory and testing its existence will consume CPU cycles. So would it be better to take up some memory space (with a zero value) or not assign anything to the key and have the code test for its existence?