Please create an account to participate in the Slashdot moderation system

 



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

Computers are unreliable, but humans are even more unreliable. Any system which depends on human reliability is unreliable. -- Gilb

Working...