1$string = 'hello|wild|world';
2list($hello, , $world) = explode('|', $string);
3echo("$hello, $world"); // hello, world
4
1// define array
2$array = ['a', 'b', 'c'];
3
4// without list()
5$a = $array[0];
6$b = $array[1];
7$c = $array[2];
8
9// with list()
10list($a, $b, $c) = $array;
11
1$arrays = [[1, 2], [3, 4], [5, 6]];
2
3foreach ($arrays as list($a, $b)) {
4 $c = $a + $b;
5 echo($c . ', '); // 3, 7, 11,
6}
7