【发布时间】:2023-03-10 00:33:02
【问题描述】:
我是 PHP 新手,使用 5.6 版。在使用间接引用的情况下,我试图了解 unset() 的功能。 unset() 如果没有其他变量引用它的值,则设置前一个变量使用的内存空闲。在我的代码中,unset() 运行良好,它返回 false。但是当我使用间接引用变量时,它仍然返回 false。 这是我的代码...
//unsetting the variable
$unset_var="darsh";
//Indirect refernces to variables
$$unset_var="new to PHP";
echo "\n\n".$darsh;
unset($unset_var);
if(isset($unset_var))
{
print "<br>".'$unset_var variable is not free to use';
}
else
{
print "<br>".'$unset_var variable is free to use';
}
【问题讨论】:
-
然后呢?间接引用在哪里?