How 2> 10 can be true in PHP?

Now I look at my code:

if(2 > 10) echo "$#@$#$#$";

and the results are that the string is displayed on the page! So how is this possible?

If I do this:

$i = 2;
$j = 10;
if($i$j) echo "$#@$#$#$";

my script generates a 500 error.

And if I do this:

$i = 2;
if($i > 10) echo "$#@$#$#$";

I get this error message:

Notice: Use of undefined constant  10 - assumed ' 10'

What could be causing this behavior?

+3
source share
1 answer

Probably works fine:

if(2 >10) echo "$#@$#$#$";

You may have a coded white space that you cannot see until 10 (which is why it says that it is supposed to be "10", not "10")

+4
source

All Articles