[TYPO3-core] RFC: Feature #4064 - Navigation title in tree view
Ernesto Baschny [cron IT]
ernst at cron-it.de
Tue Sep 4 21:42:20 CEST 2007
Martin Kutschker wrote: on 04.09.2007 20:39:
> BTW, how many ways do we use to test for an empty string?
>
> The code has this one:
>
> (strlen(trim($row['title'])) == 0)
>
> I prefer this:
>
> $var === ''
>
> but as trim returns a string trim($row['title'])=='' would be save.
>
> Elsewhere we have this:
>
> strcmp($var,'')
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.
Cheers,
Ernesto
More information about the TYPO3-team-core
mailing list