source: src/router/php7/Zend/tests/list_mixed_nested_keyed_unkeyed.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 2 months ago

update php

File size: 491 bytes
Line 
1--TEST--
2list() with nested unkeyed and keyed list()
3--FILE--
4<?php
5
6$points = [
7    ["x" => 1, "y" => 2],
8    ["x" => 2, "y" => 1]
9];
10
11list(list("x" => $x1, "y" => $y1), list("x" => $x2, "y" => $y2)) = $points;
12var_dump($x1, $y1, $x2, $y2);
13
14echo PHP_EOL;
15
16$invertedPoints = [
17    "x" => [1, 2],
18    "y" => [2, 1]
19];
20
21list("x" => list($x1, $x2), "y" => list($y1, $y2)) = $invertedPoints;
22var_dump($x1, $y1, $x2, $y2);
23
24?>
25--EXPECT--
26int(1)
27int(2)
28int(2)
29int(1)
30
31int(1)
32int(2)
33int(2)
34int(1)
Note: See TracBrowser for help on using the repository browser.