facebook / facebook/hhvm

No typechecker or runtime error when trying to append to a const collection

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

Description

### HHVM Version

```
HipHop VM 3.27.2 (rel)
hh-e6d25982534cd57e1e7fa1e990dcb876c981b957-3.27.2 Wed Aug 15 18:09:53 2018
```

### Operating System and Version

macOS High Sierra

### Standalone code, or other way to reproduce the problem

```
const arr = ['a'];
arr[] = 'b';
var_dump(arr);
```

### Actual result

Output:
```
array(1) {
[0]=>
string(1) "a"
}
```

with no errors. Same behavior when called from inside a function.

### Expected result

Should raise a typechecker error and a runtime fatal.

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.