[TYPO3-core] RFC #15020: Enhancement of t3lib_div::testInt

Steffen Kamper info at sk-typo3.de
Thu Jul 8 12:42:55 CEST 2010


Hi Dmitry,

Dmitry Dulepov schrieb:
> Hi!
> 
> Christian Futterlieb wrote:
>> Following version of testInt would be much faster, and react (IMO)
>> correct on above problem.
>>
>> function testInt ($var) {
>>     if (is_numeric($var)) {
>>         return (int) $var == $var;
>>     }
>>     return FALSE;
>> }
> 
> This uses two returns while CGL explicitly states that only a single return
> is allowed...
> 

is that so? Performance wise we decided at some places early returns, so 
we should overthink this.

vg Steffen


More information about the TYPO3-team-core mailing list