[TYPO3-core] RFC: Bug #10094: Use foreach instead of while-list-each constructs in t3lib_TCEmain

Oliver Hader oliver at typo3.org
Sun Jan 11 16:36:37 CET 2009


Hi Masi,

Martin Kutschker schrieb:
> +1 from reading, but I wonder if this kind of changes are any faster:
> 
> -2460 while(list($table,) = each($this->cmdmap)) {
> +2453 foreach (array_keys($this->cmdmap) as $table) {
> 
> We get an additional array operation.
> 
> How about using a dummy value:
> 
> -2460 while(list($table,) = each($this->cmdmap)) {
> +2453 foreach ($this->cmdmap as $table => &$dummy) {

I think and see that there is no much difference (and ran a simple
script with array_keys() and your approach to test it). The key
extraction has to be done in each case...

olly
-- 
Oliver Hader
TYPO3 4.3 Release Manager


More information about the TYPO3-team-core mailing list