[TYPO3-core] phpversion() vs PHP_VERSION

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Wed Jun 7 13:55:42 CEST 2006


Michael Stucki schrieb:
> Hi Martin,
> 
>>As for the rewriting of int_from_ver(): It is wrong. You must not use
>>round() on a version number!

Ah! I didn't get this. It looked wrong to me ;-)

> See attached patch.

Patch looks good, but not tested yet.

On more thing. Instead of

if (count($verParts)<3) { array_push($verParts, '0'); }

you may write

$verParts = array_pad(verParts,3,'0'));

That'll accept even plain "4" for "4.0.0"

Masi

PS: I still oppose float_from_ver() for PHP version check if only based on 
the ground that this PHP function was *built* to compare PHP versions.



More information about the TYPO3-team-core mailing list