Created
July 24, 2012 17:41
-
-
Save niklasvh/3171413 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
<?php | |
function i1() { | |
echo "i1\n"; | |
return 1; | |
} | |
function i2() { | |
echo "i2\n"; | |
return 1; | |
} | |
function i3() { | |
echo "i3\n"; | |
return 3; | |
} | |
function i4() { | |
global $a; | |
$a = array(10, 11, 12, 13, 14); | |
echo "i4\n"; | |
return 4; | |
} | |
$a = 0; // $a should not be indexable till the i4 has been executed | |
list($a[i1()+i2()], , list($a[i3()], $a[i4()]), $a[]) = array (0, 1, array(30, 40), 3, 4); | |
var_dump($a); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment