Submitted by FReNeTiC (not verified) on Fri, 06/19/2009 - 10:00.
When i started learning PHP 3 years ago this got me crazy too.
Since i was a C programmer, some weird bugs used to happen when i used == for comparisons. So, i decided to read the manuals...
Then, everything got explained...
At that time, i had the idea that all programming languages had the same base operations, (like = attributing a value), but they dont!
Programming languages may look like, but each one of them have a set of rules.
Your post is an example.
PHP have 2 diferent ways of comparisons, the == and the ===.
And if you dont study your selected languages rule's, you will think it's a crappy language because your programs doesn't work well.
Well, may be PHP is a crappy language, may be not =P
Manuals
When i started learning PHP 3 years ago this got me crazy too.
Since i was a C programmer, some weird bugs used to happen when i used == for comparisons. So, i decided to read the manuals...
Then, everything got explained...
At that time, i had the idea that all programming languages had the same base operations, (like = attributing a value), but they dont!
Programming languages may look like, but each one of them have a set of rules.
Your post is an example.
PHP have 2 diferent ways of comparisons, the == and the ===.
And if you dont study your selected languages rule's, you will think it's a crappy language because your programs doesn't work well.
Well, may be PHP is a crappy language, may be not =P