h <?php
echo 'this is a test<br/>';
echo 123;
echo '<br/>';
echo 12.3;
echo '<br/>';
echo true;
echo '<hr/>';
//其它类型转换成数值型
echo 1+3,'<br/>';//4
echo 1+2.3,'<br/>';//3.3
echo 1+true,'<br/>';//true->1
echo 1+false,'<br/>';//false->0
echo 1+null,'<br/>';//null->0
echo 1+'3king';//3king->3
echo '<br/>';
echo 1+'21a3b4c';//2a3b4c->2
echo '<br/>';
echo 1+'2e2a3c';//201
echo '<br/>';
echo 1+'true';//'true'->0
echo '<hr color="pink"/>';
//其它类型转换成字符串型
echo 'king<br/>';
echo 123;
echo '<br/>';
echo 23.4;
echo '<br/>';
echo true;
echo '<br/>';
echo '#',false,'#';
echo '<br/>';
echo '@',null,'@';
echo '<br/>';
$arr=array();
echo $arr;//Array
echo '<br/>';
$handle=fopen('./test.html','r');
echo $handle;//Resource id #3
echo '<br/>';
//对象不能直接转换成字符串,会报致命错误,程序终止执行
$obj=new StdClass();
echo $obj;
echo '<br/>';
echo 'this is king show time<br/>';
为什么上面这些例子会自动转换?是有什么命令触发了吗?