Home >Backend Development >PHP Tutorial >4——PHP comparison && copy operator phpstorm php download how to copy

4——PHP comparison && copy operator phpstorm php download how to copy

WBOY
WBOYOriginal
2016-07-29 08:48:45972browse
*/
 * Copyright (c) 2016,烟台大学计算机与控制工程学院
 * All rights reserved.
 * 文件名:text.cpp
 * 作者:常轩
 * 微信公众号:Worldhello
 * 完成日期:2016年5月19日
 * 版本号:V1.0
 * 问题描述:PHP比较运算符
 * 程序输入:无
 * 程序输出:见运行结果
 */
<?php  
        $a = 1;
	$b = "1";
	var_dump($a==$b);
	echo "<br />";
	var_dump($a===$b);
	echo "<br />";
	var_dump($a!=$b);
	echo "<br />";
	var_dump($a<>$b);
	echo "<br />";
	var_dump($a!==$b);
	echo "<br />";
	var_dump($a<$b);
	echo "<br />";

	$c = 5;
	var_dump($a<$c);
	echo "<br />";
	var_dump($a>$c);
	echo "<br />";
	var_dump($a<=$c);
	echo "<br />";
	var_dump($a>=$c);
	echo "<br />";
	var_dump($a>=$b);
	echo "<br />";
?>

Running results:

bool(true)

bool(false)

bool(false)

bool(false)

bool(true)

bool(false)

bool(true)

bool(false)

bool(true)

bool(false)

bool(true)

Appendix:

php 复制文件,php 数组 复制,php文件重命名复制,php复制内容到剪切板,php 数据库复制表,php 对象深复制,php教程,复制的快捷键,空格复制,全能复制,php工程师,php源码,phpstorm,php下载,怎么复

*/
 * Copyright (c) 2016,烟台大学计算机与控制工程学院
 * All rights reserved.
 * 文件名:text.cpp
 * 作者:常轩
 * 微信公众号:Worldhello
 * 完成日期:2016年5月19日
 * 版本号:V1.0
 * 问题描述:PHP比较运算符
 * 程序输入:无
 * 程序输出:见运行结果
 */
//赋值运算符
<?php 
    $a = "我在学习PHP!";
	$b=$a;
	
	$a = "我天天在学习PHP!";
	$c=&$a;
	echo $b."<br />";
	echo $c."<br />";
?>

Running results:

我在学习PHP!
我天天在学习PHP!

Note:

(1) "=": Assign the value of the expression on the right to the operation on the left number. It copies the value of the expression on the right and gives it to the operand on the left. In other words, first allocate a memory for the operand on the left, and then put the copied value into this memory.

(2) "&": reference assignment, which means that both variables point to the same data. It will cause two variables to share a piece of memory. If the data stored in this memory changes, the values ​​of both variables will change.


The above has introduced 4 - PHP comparison && copy operator, including PHP and copy content. I hope it will be helpful to friends who are interested in PHP tutorials.

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