[TYPO3-core] RFC #16321: Bug: Numeric zero for representation of weekday sunday is not accepted

François Suter fsu-lists at cobweb.ch
Fri Nov 26 12:47:21 CET 2010


Hi,

>> Nitpick:
>> + if (0 === strcmp($weekday, '0')) {
>>
>> Please swap variable and constant.
>> This is a "Yoda condition": "If blue is the sky" :) [1]
>
> The empire strikes back; attached is v1 taking your note into account.
> I've additionally added the unchanged unit test for completeness.

Works as advertised, but the above condition was not changed in v1.

Also I dislike the use of strcmp(). I find it always confusing. Is it 
really necessary here? Can't we just use:

if ($weekday === '0') {

?

Cheers

-- 

Francois Suter
Cobweb Development Sarl - http://www.cobweb.ch


More information about the TYPO3-team-core mailing list