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

php基础 ||有关问题

WBOY
Release: 2016-06-13 11:58:12
Original
994 people have browsed it

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 />?>
Copy after login
打印结果:
1 0<br />1 0<br />1 1
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template