Re: [off] PHP: a fractal of bad design

From: Date: Tue, 08 May 2012 01:25:57 +0000
Subject: Re: [off] PHP: a fractal of bad design
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
I was very surprised when I came across the == issue sometime ago. IMO
strings should be compared as strings. They should never be converted to
integer.


1=="1"          // always convert the number value to a string and then
compare it
"foo" == 0    //  should return false

"123abc" == "123nth" // compare as string. Do not convert to numeric values

"0"==0     //  true
0=="0."  // false

PHP is great but if we can work together to remove the flaws, then we can
make it even greater. We have to leave the past behind us and look at where
we want PHP to be in the next 5 years


Best regards,


Thread (42 messages)

« previous php.internals (#60515) next »