[TYPO3-core] RFC: Fix bug #1391: Typo3 can't display a single "0" in a table cell

René Fritz rene at typo3.org
Tue Feb 28 12:29:11 CET 2006


> Michael Stucki wrote:
> > The solution is to add a new property which compares the value using
> > strcmp('',$value).
>
> Don't use strcmp if you don't really want to compare the string. If you
> want to test if it is set rather use strlen($str).
>
> Here the output of a little test program:
>
> Time for 1000000 strlen: 0.866 (100%)
> Time for 1000000 strcmp(): 0.971 (112.15%)
> Result OK
> Time for 1000000 strlen: 0.878 (100%)
> Time for 1000000 strcmp(): 0.967 (110.12%)
> Result OK
> Time for 1000000 strlen: 0.870 (100%)
> Time for 1000000 strcmp(): 0.970 (111.50%)
> Result OK
>
> Fine ?

Could we then change all the ugly occurencies of strcmp() in the code base to 
strlen()?! Kasper had a reason for that but if strlen() do the same I prefer 
that.

René

-- 
René Fritz
TYPO3 Association - Active Member
http://association.typo3.org/



More information about the TYPO3-team-core mailing list