Skip to content

Conversation

@thekid
Copy link
Member

@thekid thekid commented Nov 12, 2022

Implements #31 (w/o the foreach part). Previously, these statements would produce a parse error syntax error, unexpected '&', expecting ',' or ')'.

Works as follows:

// Input, either as list() or using the following shorthand form
[&$a, &$b]= $expr;

// Emitted code for PHP 7.3+
list(&$a, &$b)= $expr;

// Emitted code for PHP 7.0, 7.1 and 7.2
null === ($__t= &$expr) ? null : [$a= &$__t[0], $b= &$__t[1]];

@thekid thekid merged commit 230903c into master Nov 12, 2022
@thekid thekid deleted the feature/list-reference-assignment branch November 12, 2022 12:30
@thekid
Copy link
Member Author

thekid commented Nov 12, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant