facebook / facebook/hhvm

Heredocs are allowed in user attributes

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

Description

Not a real problem as such, just seems undesirable and likely to be an oversight. If my regexes are good, facebook doesn't use this internally.

### HHVM Version

3.15.2 and current fb-internal:

```
[fredemmott@devbig349.prn1 /tmp/hhtest] hhvm --version
HipHop VM 3.16.0-dev (rel)
Compiler: default-0-g5f2bdbc7431f0f0d2448b9077b2ab717ad34f092
Repo schema: 27af8e6d33227de8e3cf0d7adfeafca670e244e1
[fredemmott@devbig349.prn1 /tmp/hhtest] hh_client --version
af36592ac5e4b162e8afa4254ba00b04bdabd018 Sat Nov 5 18:05:22 2016
```

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

```
>
function bar(): void {}

var_dump((new ReflectionFunction('bar'))->getAttributes());
```

### Expected result

Hack error, runtime error

### Actual result

```
[fredemmott@devbig349.prn1 /tmp/hhtest] hh_client
No errors!
[fredemmott@devbig349.prn1 /tmp/hhtest] hhvm test.php
array(1) {
["Foo"]=>
array(1) {
[0]=>
string(9) "herp
derp"
}
}
```

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.