Last active
October 4, 2019 10:50
-
-
Save rkyoku/ff9dc34fa91c2a0bf8b968d312b4d8fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$aTest = array( | |
5 => array('pseudo' => 'donald'), | |
200 => array('pseudo' => 'mickey') | |
); | |
echo 'Before script'; | |
var_dump($aTest); | |
foreach ($aTest as $iId => &$aData) | |
$aData['test'] = $iId; | |
// Should unset $aData here!! References are tricky | |
echo 'After reference loop'; | |
var_dump($aTest); | |
foreach ($aTest as $iId => $aData) | |
; | |
echo 'After same variable name loop but no reference'; | |
var_dump($aTest); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment