[TYPO3-core] RFC #13998: Introduce Automatic versioning of CSS and JS files

Jigal van Hemert jigal at xs4all.nl
Wed Apr 7 08:44:56 CEST 2010


Georg Ringer wrote:
> - code
> -------------------------------------
> +			if ($lookupFile[1]) {
> +				$separator = '&';
> +			} else {
> +				$separator = '?';
> +			}
> -------------------------------------
> could be just a $seperator = ($lookupFile[1]) ? '&' : '?';
> IMO this is also faster

No. I ran a benchmark on PHP 5.3 Win and found a couple of benchmarks on 
the web, which all indicated that the ternary operator is marginally 
slower than an if statement.
If you use the ternary operator in a situation where the 'else' action 
is actually no operation, the if becomes a lot faster if the condition 
is false.

-- 
Jigal van Hemert.


More information about the TYPO3-team-core mailing list