Home  >  Article  >  Backend Development  >  php基础 ||有关问题

php基础 ||有关问题

WBOY
WBOYOriginal
2016-06-13 11:58:12960browse

php基础 ||问题

<?php<br /><br />	$a=0;<br />	$b=0;<br /><br />	if($a=3 || $b=3)        //相当于 if($a = (3 || $b=3)),true的结果是1,false的结果是0;<br />	{<br />		echo $a." ".$b."<br>";<br />		$a++;<br />		echo $a." ".$b."<br>";<br />		$b++;<br />		echo $a." ".$b."<br>";<br />	}<br /><br />?>
打印结果:
1 0<br />1 0<br />1 1

请问第9行的$a++没有执行,这是为什么呢?
------解决方案--------------------
if($a=intval(3 
------解决方案--------------------
 $b=3))
布尔值应该不能++ -- 的吧

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn