[TYPO3-core] RFC: Feature #4064 - Navigation title in tree view

Ingmar Schlecht ingmar at typo3.org
Wed Sep 5 18:27:40 CEST 2007


Ernesto Baschny [cron IT] schrieb:
> Ingmar Schlecht wrote: on 05.09.2007 10:47:
> 
>>> I have stumbled over the same question in my previous patch! I usually
>>> dislike strcmp because it is very unintuitive when reading. The "==="
>>> comparison is more my style and much easier to read. Is it slower? More
>>> error prone? If not, I would stick to that.
> 
>> The problem with === for string comparisons is that
>> 	123 === '123'
>> returns false, whereas
>> 	!strcmp(123, '123')
>> returns true.
>>
>> So there is a little difference between the two which sometimes makes it
>> handier to use strcmp.
> 
> This is exactly why I would *use* === instead of strcmp, because I want
> to compare a string with a string. If I don't want that, I can use "=="
> and also don't need strcmp.

Well no, == is no option if you want to return true on things like
123=='123' because it has the nasty behaviour of returning true on
0=='typo3'.

Anyway, !strcmp() and === both have their advantages, you just need to
understand the differences.

cheers
Ingmar

-- 
Ingmar Schlecht
TYPO3 Association Active Member


More information about the TYPO3-team-core mailing list