Skip to content

Instantly share code, notes, and snippets.

@0xPr0xy
Created October 14, 2014 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xPr0xy/80a6f00a4c1416ff1f5b to your computer and use it in GitHub Desktop.
Save 0xPr0xy/80a6f00a4c1416ff1f5b to your computer and use it in GitHub Desktop.
foreach.php
$a = array ('zero','one','two', 'three');
foreach ($a as &$v) {
}
foreach ($a as $v) {
echo $v.PHP_EOL;
}
// Can somebody explain why the output is: zero one two two .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment