I was confused as to why a piece of my code was acting strangely, and I think I have isolated it down to a bug in the engine.
Here is an example console I/O of the bug.
==>$var1 = "1.3"; //first set up variables
==>$var2 = "1.3";
==>echo($var1 > $var2);
0
==>echo($var1 < $var2);
0
==>echo($var1 == $var2); //everything is as expected
1
==>$var2 = "1.3 junk"; //change this variable with an extra word
==>echo($var1 > getword($var2, 0));
0
==>echo($var1 < getword($var2, 0)); //this seems strange
1
==>$var3 = getword($var2, 0); //lets make a third variable out of the first word of $var2
==>echo($var3); //make sure it is what we expect
1.3
==>echo(strlen($var3)); //no trailing spaces
3
==>echo($var1 == $var3); //looks good
1
==>echo($var1 $= $var3);
1
==>echo($var1 == $var2);
1 //I don't know if this is correct or not, but $var2 is two words
==>echo($var1 == getword($var2, 0)); //run this again to make sure it hasn't changed
0
==>echo($var2);
1.3 junk
==>echo($var1 $= getword($var2, 0)); //Apparently they have the same characters but are not equal
1
==>echo("1.3" + "10.0"); //floating point numbers casting from strings seems to work
11.3
==>echo($var1 == (getword($var2, 0) + 0.0)); //force a cast to decimal before checking equality
0
==>echo(($var1 + 0.0) == (getword($var2, 0) + 0.0)); //force both to be decimals
0
==>echo(($var1 + 0.0) $= (getword($var2, 0) + 0.0)); //they are still the same strings
1
Any thoughts? Am I crazy or is this definitely a bug?