TheDocumentation Index
Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
Use this file to discover all available pages before exploring further.
=== operator, known as the strict equality or identity operator, evaluates whether two operands are identical in both value and data type without performing implicit type coercion (type juggling). If the operands are of different data types, the PHP engine immediately evaluates the expression to false.
Syntax
true if the operands are strictly identical, and false otherwise.
Evaluation Mechanics by Data Type
The behavior of the=== operator varies depending on the underlying types of the operands being compared:
1. Scalar Types (Integers, Floats, Strings, Booleans)
For scalar values, the operator checks the internal type flag of the zval (Zend value) container. If the type flags match, it compares the underlying values. For integers, strings, and booleans, the values must be exactly identical. For floating-point numbers, PHP applies standard IEEE 754 rules rather than a raw memory byte comparison. Under these rules,0.0 and -0.0 are considered strictly equal despite differing sign bits, while NAN is never strictly equal to anything, including itself.
2. Arrays
When comparing arrays,=== evaluates to true only if both arrays satisfy all of the following conditions:
- They contain the exact same number of elements.
- They contain the exact same key-value pairs.
- The keys are defined in the exact same insertion order.
- The values for corresponding keys are strictly identical (
===).
3. Objects
For object comparison, the=== operator does not compare the internal properties or class types of the objects. Instead, it evaluates to true if and only if both operands are references pointing to the exact same object instance in memory (object identity).
Related Operator
The logical negation of the strict equality operator is the strict inequality operator, represented by!==. It returns true if the operands differ in either value or data type.
Master PHP with Deep Grasping Methodology!Learn More





