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

Michiel Roos [netcreators] michiel at netcreators.com
Wed Jul 7 10:46:20 CEST 2010


On 7/7/10 10:28 AM, Steffen Ritter wrote:
> Am 07.07.2010 10:21, schrieb Steffen Kamper:
>> it seems that t3lib_div::testInt was written for strings mainly.
>> The name of the function is misleading here.
>> What's about
> 
> return ((string)intval($var) == $var);
> 
> would be better i think, to enshure that $var is not casted to string
> but string compared

Nice, that one keeps the original behavior and has a more or less decent
performance gain of ~25-50%.

Please see attached test file.

-- 
Met vriendelijke groet / Warm regards,

Michiel Roos
Chief Technical Officer
Netcreators: Open Source, Open Minds, Open People
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 15020_testInt_test_v3.php
Type: text/php
Size: 2561 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100707/fd425c3b/attachment.bin>


More information about the TYPO3-team-core mailing list