[TYPO3-core] RFC: Bug #6114: t3lib_extMgm::addToAllTCATypes ignores type 0

Ingmar Schlecht ingmar at typo3.org
Tue Dec 4 23:24:02 CET 2007


Dmitry Dulepov [typo3] wrote:
> There are two different cases here depending on variable type.
> 
> If $a == '0', than $a == '' is false (because string '0' is not equal to
> string '').
> If $a == 0, than $a == '' evaluates to true (because values of different
> types are converted to values of a single common type before comparison,
> here to integer 0 and then 0 equals 0)

Exactly, therefore my comment.

> Safest and fastest way here is $a === '' (notice three equals!) because
> uses language construct (not a function call). To be paranoically
> safest: trim($a) === '' but this is an overkill I think :)

Or: (string)$specificTypesList === ''

But just using === is totally fine in this case. Jeff, I think you can
just commit this no-brainer now that we have discussed this.

cheers
Ingmar


-- 
Ingmar Schlecht
TYPO3 Association Active Member


More information about the TYPO3-team-core mailing list