Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror

Comment Intransitive equality and comparison in PHP (Score 1) 729

One of the many lovely things about PHP, though this time it's not the only culprit.

$ php -r 'var_dump("foo" == TRUE); var_dump("foo" == 0); var_dump(TRUE == 0);'
bool(true)
bool(true)
bool(false)

$ php -r 'var_dump(NULL == 0); var_dump(NULL < -1);'
bool(true)
bool(true)

Strange, and not in a good way. Makes the mathematical part of my brain explode.

Slashdot Top Deals

"Just Say No." - Nancy Reagan "No." - Ronald Reagan

Working...