$load_traff = 36333298;
$value = 1205553404;
if ( $load_traff gt $value ) {
print("Inside if. \n");
}
else{
print("Out of if. \n");
}
Output
Inside if.
Why does the above code give incorrect answer while below code gives correct answer?
$load_traff = 36333298;
$value = 1205553404;
if ( $load_traff > $value ) {
print("Inside if. \n");
}
else{
print("Out of if. \n");
}
Output
Out of if.
The ‘gt’ operator does a string comparison (along with lt, eq). $load_traff is “lexically” greater than $value.