当前位置:网站首页>PHP等于==和恒等于===的区别
PHP等于==和恒等于===的区别
2022-07-25 18:47:00 【幕尘枫】
PHP的比较运算符:
中等式(==),在Thinkphp的模板里用 eq表示
恒等式(===),在Thinkphp的模板里用 heq表示
两者区别:
1、等式(==)运算
等式(==)运算符是比较、并测试左边的变量(表达式或常量)是否与右边的变量(表达式或常量)具有相同的值;该运算符进行的比较是松散的。 如果两个值相同(它只比较变量的值,而不是数据类型),则返回true值;如果两个值不相同,则返回false值。
2、恒等式(===)运算
恒等式(===)运算符是进行给定变量或值之间的严格比较;它比较,并查看两个变量(表达式或常量)是否值相等且具有相同的数据类型,即两者都是字符串或两者都是整数等等。 如果两个变量(表达式或常量)包含相同的值和相同的数据类型,则此运算符返回true,否则返回false。
边栏推荐
- 接口自动化测试平台FasterRunner系列(一)- 简介、安装部署、启动服务、访问地址、配置补充
- 信达证券是国企吗?在信达证券开户资金安全吗?
- 华为年内二度招聘“天才少年”;540万Twitter账号信息泄露,卖价3万美元;谷歌解雇了相信AI有意识的工程师|极客头条
- Advanced software testing - test classification
- 浅析IM即时通讯开发出现上网卡顿?网络掉线?
- [open source project] stm32c8t6 + ADC signal acquisition + OLED waveform display
- #夏日挑战赛#【FFH】这个盛夏,来一场“清凉”的代码雨!
- 关爱一线防疫工作者,浩城嘉业携手高米店街道办事处共筑公益长城
- Regex 正则表达式
- 拍卖行作VC,第一次出手就投了个Web3
猜你喜欢

Circulaindicator component, which makes the indicator style more diversified

15. Simple salary management system design

什么是3DE体验平台

A brief history from object detection to image segmentation

韩国AI团队抄袭震动学界!1个导师带51个学生,还是抄袭惯犯

Deng Qinglin, a technical expert of Alibaba cloud: Best Practices for disaster recovery and remote multi activity across availability zones on cloud

CircleIndicator组件,使指示器风格更加多样化

阿里云技术专家郝晨栋:云上可观测能力——问题的发现与定位实践

3de 回复

Visual model network connection
随机推荐
Virtual machine VMware installation steps (how to install software in virtual machine)
进程间的通信(管道通信)
怎样设计产品帮助中心?以下几点不可忽视
F5:企业数字化转型所需六大能力
Software testing (mind mapping)
[open source project] stm32c8t6 + ADC signal acquisition + OLED waveform display
Baklib:制作优秀的产品说明手册
rust多线程安全计数
请问什么是国债逆回购?安全吗?
Osmosis extends its cross chain footprint to poca through integration with axelar and moonbeam
如何创建一个有效的帮助文档?
浅析IM即时通讯开发出现上网卡顿?网络掉线?
Baklib: make excellent product instruction manual
VC/PE正跑向青岛
What is the difference between GB and gib disk space units?
How to design product help center? The following points cannot be ignored
[translation] LFX 2022 spring tutor qualification opening - apply for CNCF project before February 13!
What is 3DE experience platform
How to prohibit the use of 360 browser (how to disable the built-in browser)
Vc/pe is running towards Qingdao