Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between php=== and = =

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "what is the difference between php === and ==". In daily operation, I believe many people have doubts about the difference between php == and ==. Xiaobian consulted various materials and sorted out simple and easy operation methods. I hope to help you answer the doubts of "what is the difference between php == and =="! Next, please follow the small series to learn together!

Php === and == difference: 1, in PHP === means congruent operator, and == means equal operator;2, if the values on both sides of the equal operator are equal, then return true, and if the values on both sides of the congruent operator are equal but of different types, then return false.

Operating environment: Windows 7 system, PHP7.1 version, DELL G3 computer

What is the difference between php == and ==?

Php == and === usage and difference

In the development of the approach encountered numerical matching problems, then in the matching, encountered the following situation, what do you think the result is?

Surprisingly, the output of the above program is true, which means that 0 and 0dff are equal by default in compilation. This is because the relational operation "==" requires that the data types on both sides of the operator be the same, so the string to the right of the equal sign is coerced to integer 0.

This is also a disadvantage of a range of weakly typed languages. In php "===" is provided to solve this problem.

The output of this program is false.

The full equality operation process is as follows:

1. Determine whether the data types of the two sides of the congruent operator are the same. If not, return false.

2. Determine whether the values of the two sides of the congruent operator are equal. If not, return false.

3. Finally, perform the above 2 steps and operations. Returns the result of the operation with.

Attached:

At this point, the study of "what is the difference between php == and ==" is over, hoping to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report