1
hardway 2016-04-08 22:40:19 +08:00
少打"list"四个字而已
list($a,$b,$c)=[1,2,3]; |
2
jfcherng 2016-04-08 23:45:27 +08:00
@hardway
// This is not allowed: list([$a, $b], [$c, $d]) = [[1, 2], [3, 4]]; // This is also not allowed: [list($a, $b), list($c, $d)] = [[1, 2], [3, 4]]; // This, however, is allowed: [[$a, $b], [$c, $d]] = [[1, 2], [3, 4]]; |
3
jfcherng 2016-04-08 23:46:45 +08:00
foreach ($points as ["x" => $x, "y" => $y]) {
var_dump($x, $y); } |