<?php

echo 'PHP VERSION:'.PHP_VERSION;
echo '<br />';

$a = 'abc';

$example = 1;

if($example == 1) {

   unset($a[0]); // Fatal error: Cannot unset string offsets in

} elseif($example == 2) {

   $b = $a[0][0]; // Fatal error: Cannot use string offset as an array in …
}

?>

这个故障偶尔程序员会犯,尤其是 例子2这种无效赋值。
Tags:
PHP | 评论(0) | 引用(0) | 阅读(13286)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]