Project

General

Profile

Actions

Bug #23113

closed

Enhancement of t3lib_div::testInt

Added by Michiel Roos almost 14 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-07-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

t3lib_div::testInt can be optimized by making use of the PHP version of testInt called: is_int.

This function is still used in the core: 129 times.

A speed gain from ~ 45 - 81 % can be achieved on this function.

In addition to changing this function to use is_int, all calls to t3lib_div::testInt should be replaced by is_int.

I don't see the point of calling a special function just to call a single function inside.

(issue imported from #M15020)


Files

15020_testInt_v1.diff (482 Bytes) 15020_testInt_v1.diff Administrator Admin, 2010-07-06 23:43
15020_testInt_test_v1.php (906 Bytes) 15020_testInt_test_v1.php Administrator Admin, 2010-07-06 23:43

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #23508: PHP Warning in Template module: mb_strlen() expects parameter 1 to be string, array givenClosedSteffen Gebert2010-09-06

Actions
Related to TYPO3 Core - Bug #23525: Enhancement of t3lib_div::testInt introduced a different behaviourClosedErnesto Baschny2010-09-11

Actions
Related to TYPO3 Core - Bug #28617: t3lib_utility_Math::canBeInterpretedAsInteger() fails on values with whitespaces or leading zerosRejectedStefan Neufeind2011-07-31

Actions
Actions #1

Updated by Dmitry Dulepov almost 14 years ago

As discussed in the core list. is_int() is not the same as t3lib_div::testInt(). Therefore the issue is set as "won't fix".

Note that using is_numeric() is not an option either because is_numeric(' 5') will return true while t3lib_div::testInt() will return false.

Actions #2

Updated by Steffen Kamper over 13 years ago

Committed patch an test to svn
4_4 rev 8585
trunk rev 8586

Actions #3

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF