- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between !== and ==! operator in PHP
'!==' comparison operator
'!==' operator checks the unequality of two objects with a type check. It does not converts the datatype and makes a typed check.For example 1 !== '1' will results true.
'==!' comparison operator
'==!' operator is combination of two operators and can be written as == (!operands).
Example
Following example, shows usage of '!==' vs '==!' operators.
<!DOCTYPE html> <html> <head> <title>PHP Example</title> </head> <body> <?php $x = true; $y = false; echo '$x !== operator $y = '; // $x not equals to $y // so true returned var_dump($x !== $y); print("<br/>"); echo '$x ==! operator $y = '; // !$y is true which is same as $x // so true returned var_dump($x ==! $y); ?> </body> </html>
Output
$x !== operator $y = bool(true) $x ==! operator $y = bool(true)
Advertisements