求解释这段代码

@Ta 2013-03-10 4040点击
<?php
#test 1
if(!isset($foo{5}))
 {
  echo 'fool short';
 }
 
#test 2
$foo = 4;
if(!isset($foo{5}))
 {
  echo 'fool short';
 }
 
#test 3
$foo = 9;
if(!isset($foo{5}))
 {
  echo 'fool short';
 }

?> 
我测试了下输出了三个foo short
为什么?那个判断句在判断什么

大家看我刚试的:
#test 5 有输出
$foo = 'hjkldsior';
if(!isset($foo{5}))
 {
  echo 'fool short';
 } 

#test 6 没有输出
$foo = 'huoejiof';
if(!isset($foo{2-3}))
 {
  echo 'fool short';
 }
回复列表(10|显示机器人聊天)
添加新回复
回复需要登录