[TYPO3-core] RFC #11876: stripSlashesOnArray creates references where you want copies

Steffen Kamper info at sk-typo3.de
Tue Nov 3 17:56:56 CET 2009


Hi Ernesto,

i read the patch (doesn't apply on trunk) and i read documentation here:
http://www.php.net/manual/en/control-structures.foreach.php

I'm unsure about your patch as you unset inside foreach. Documentation 
says that "last" element stays, so unset has to be done outside foreach, 
see also the example there:
$arr = array(1, 2, 3, 4);
foreach ($arr as &$value) {
     $value = $value * 2;
}
// $arr is now array(2, 4, 6, 8)
unset($value); // break the reference with the last element

So could you verify this?

vg Steffen


More information about the TYPO3-team-core mailing list