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.
> (greater than) operator is a binary relational operator that evaluates whether the value of its left operand is strictly larger than the value of its right operand. It returns a boolean true if the condition is met, and false otherwise.
> operator utilizes internal type juggling (coercion) when evaluating operands of differing data types. The Zend Engine applies specific comparison rules based on the types involved:
- Numeric vs. Numeric (Integer/Float): Performs a standard mathematical comparison.
- String vs. String: If both strings are well-formed numeric strings, PHP casts them to numbers and performs a mathematical comparison. Otherwise, it performs a lexicographical (alphabetical) comparison based on the underlying byte (ASCII) values of the characters.
- Numeric vs. String:
- PHP 8.0 and later: If the string contains a well-formed numeric value, it is cast to a number for mathematical comparison. If the string is non-numeric, the number is cast to a string, and a lexicographical comparison is performed.
- Prior to PHP 8.0: The string is aggressively cast to a number (often evaluating to
0if non-numeric) before comparison.
- Boolean vs. Any Type: The non-boolean operand is cast to a boolean before comparison. In PHP,
falseis considered less thantrue. - Array vs. Array: Evaluates the count of elements. An array with more elements is considered greater. If the counts are identical, PHP recursively compares the values of the elements key by key.
Syntax and Evaluation Examples
Operator Precedence and Associativity
The> operator has non-associative directionality. It sits lower in the precedence table than arithmetic operators (+, -, *, /) but higher than logical operators (&&, ||) and assignment operators (=).
Because it is non-associative, chaining the operator without explicit grouping parentheses results in a parse error.
Master PHP with Deep Grasping Methodology!Learn More





