"! > = " wrong
not more the same as?
ex: 4 not more the same as 9
thx's
A common source of confusion is trying to combine the logical NOT symbol directly with a comparison operator. tried that in the thread and steered things toward a clearer condition. In PHP there is no single operator that is "not greater-or-equal"; you either negate the whole comparison or use the complementary comparison. Using parentheses makes intent explicit and avoids precedence surprises.
Correct patterns (variables renamed here to avoid repeating earlier snippets):
if (!($value >= $limit) || $value < $otherLimit) {
echo "true";
} or, where appropriate, use the complementary comparison directly (negating "greater-or-equal" is the same as "less than"). Parentheses are useful when mixing ! with && or ||.
Troubleshooting tips: if a condition behaves unexpectedly, check operand types with var_dump (strings vs numbers can change comparisons), and add parentheses to force the evaluation order you mean. If strictness matters, prefer strict comparisons elsewhere and validate inputs before comparing.
For precise operator behaviour and precedence, see the PHP manual on comparison operators: PHP comparison operators.
Jump to Post— broj1 356Can you state in plain english what is the condition you want to check?
Can you state in plain english what is the condition you want to check?
$a = 21;
$b = 25;
$c = 30;
if($a < $b || $a !>= $c ){
echo "true";
} if $a > from $c = false
Is this the condition you want to check:
if($a < $b || $a < $c) or in plain english: if $a is less than $b or $a is not greater or equal to $c?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.