-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support shorthand list assignment (#50)
* Tests: add test for destructuring assignment * Support shorthand list assignment
- Loading branch information
1 parent
8ff2790
commit 25823a9
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
16 changes: 16 additions & 0 deletions
16
VariableAnalysis/Tests/CodeAnalysis/fixtures/DestructuringFixture.php
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
function function_with_destructuring_assignment() { | ||
[$a, $b] = [1, 2]; | ||
[$c, $d] = [3, 4]; // unused | ||
echo $a; | ||
echo $b; | ||
echo $c; | ||
} | ||
|
||
function function_with_destructuring_assignment_using_list() { | ||
list( $a, $b ) = [1, 2]; | ||
list( $c, $d ) = [3, 4]; // unused | ||
echo $a; | ||
echo $b; | ||
echo $c; | ||
} |