Ald*_*ein 9 php static if-statement variable-declaration
我的配置文件中有这样的结构:
<?php
if (true) {
$nonstatic = 1;
static $config = 1;
}
else {
$nonstatic = 2;
static $config = 2;
}
echo $nonstatic;
echo $config;
?>
Run Code Online (Sandbox Code Playgroud)
那么为什么$ config包含2如果该部分语句为false且$ nonstatic包含1?这是一个错误吗?
| 归档时间: |
|
| 查看次数: |
262 次 |
| 最近记录: |