[TYPO3-core] RFC #15644: Replace magic numbers for shortcut_mode with class constants
Ernesto Baschny [cron IT]
ernst at cron-it.de
Tue Sep 7 01:04:37 CEST 2010
Am 07.09.2010 00:07, Steffen Kamper schrieb:
> Ernesto Baschny [cron IT] schrieb:
>>
>> If you do an "sql_fetch_assoc()" (like it is done here to get $row), you
>> get an array full of strings, regardless of the field type in the DB. So
>> a strict check like:
>>
>
>
> you are right, i checked it. Don't understand why though, it's not
> documented in php docs. Do you know where this is documented?
>
> If so, shouldn't the constants are strings because they are used for
> this check? So compare a string with int doesn't make big sense.
It has always been like that:
http://de2.php.net/manual/en/function.mysql-fetch-assoc.php
So if you want to have "real types" in the output of a DB SELECT, you
need to case stuff by yourself, or have an DB abstraction layer doing
that for you.
The constants are integers just like the integers they replace were. We
compare them as before, PHP casts automatically from string to integer
in these kind of comparisions. So I would keep them as is.
Cheers,
Ernesto
More information about the TYPO3-team-core
mailing list