facebook / facebook/hhvm

Add support for specifying keys for list()

Open
#7,536 2 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
C++
Stars
18.7k
Forks
3.1k
Avg merge
1h 47m
Merged PRs (30d)
2

Description

PHP 7.1.0 updated `list` to allow you to specify the keys you want to destructure. See https://wiki.php.net/rfc/list_keys for the RFC

3v4l: https://3v4l.org/rXOGC

### HHVM Version
3.16.0-dev

### Standalone code, or other way to reproduce the problem
```
'Facebook', 'name' => 'Daniel'];
list('name' => $name) = $data;
echo 'Hello ', $name;
```

### Expected result
```
Hello Daniel
```

### Actual result
```
Fatal error: syntax error, unexpected T_DOUBLE_ARROW, expecting T_DOUBLE_COLON in /tmp/test.php on line 3
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.