> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PHP Not Identical

The `!==` operator is the strict inequality (or "not identical") operator in PHP. It evaluates two operands and returns `true` if they are not equal in value *or* if they are not of the exact same data type. It returns `false` only when both operands share the identical type and value.

Unlike the loose inequality operator (`!=`), the `!==` operator strictly bypasses PHP's internal type juggling (type coercion). It will never attempt to cast operands to a common type before performing the comparison.

```php theme={"dark"}
$result = $expression1 !== $expression2;
```

## Evaluation Mechanics

When the PHP engine executes a `!==` operation, it follows a strict two-step evaluation sequence:

1. **Type Comparison:** PHP first inspects the internal data types (e.g., `integer`, `string`, `boolean`, `null`) of both operands. If the types differ, the engine immediately halts evaluation and returns `true`.
2. **Value Comparison:** If, and only if, the data types are identical, PHP proceeds to compare the actual values. If the values differ, it returns `true`. If the values are exactly the same, it returns `false`.

## Syntax Visualization

```php theme={"dark"}
// 1. Type mismatch (returns true)
1 !== "1"         // true  (integer vs. string)
1 !== true        // true  (integer vs. boolean)
0 !== null        // true  (integer vs. null)
0 !== false       // true  (integer vs. boolean)

// 2. Type match, value mismatch (returns true)
10 !== 20         // true  (both integers)
"foo" !== "bar"   // true  (both strings)
"PHP" !== "php"   // true  (case-sensitive string comparison)

// 3. Type match, value match (returns false)
10 !== 10         // false (identical type and value)
"foo" !== "foo"   // false (identical type and value)
```

## Complex Type Behavior

The strict inequality operator applies specific rules when evaluating compound types (objects and arrays).

**Objects**
When comparing objects, `!==` evaluates object identity, not just property equality. It returns `false` if and only if both operands reference the exact same instance in memory. Two distinct instances of the same class with identical properties will evaluate to `true`.

```php theme={"dark"}
$objA = new stdClass();
$objB = new stdClass();
$objC = $objA;

$objA !== $objB; // true  (different instances in memory)
$objA !== $objC; // false (references to the exact same instance)
```

**Arrays**
For arrays, `!==` evaluates to `false` only if both arrays contain the exact same key-value pairs, in the exact same order, and the values are of the exact same strict types. Any deviation in order, keys, values, or types results in `true`.

```php theme={"dark"}
$arr1 = [1, 2, 3];
$arr2 = [1, 2, "3"];
$arr3 = [1, 3, 2];

$arr1 !== $arr2; // true (type mismatch on the third element: integer vs. string)
$arr1 !== $arr3; // true (order mismatch)
$arr1 !== [1, 2, 3]; // false (identical keys, values, types, and order)
```

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor PHP Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
