To unset a variable without cheking whether it has been already used or declared.Which is valid in PHP: (a) or (b)? Although both works. In the sample code below,forward referencing is used,how PHP handles it internally?
(a)
while(stmt1->fetch())
{
unset($data);
$i=0;
while(stmt2->fetch())
{
//Some code.......
$data[$i] = $some_Value;
$i++;
}
}
(b)
while(stmt1->fetch())
{
if(isset($data))
{
unset($data);
}
$i=0;
while(stmt2->fetch())
{
//Some code.......
$data[$i] = $some_Value;
$i++;
}
}