Make Call-time Pass-by-reference a Parse error
commit22486c786ec576b4977653adf1065df3e86362d2
authorDwayne Reeves <dreeves@fb.com>
Fri, 23 Oct 2015 17:47:36 +0000 (23 10:47 -0700)
committerhhvm-bot <hhvm-bot@fb.com>
Fri, 23 Oct 2015 18:00:42 +0000 (23 11:00 -0700)
tree9ae51b7426436b17b4dff0bd757cd384c0b4b39a
parent69ac4bd4218746255b079f33b8c8312b073cb582
Make Call-time Pass-by-reference a Parse error

Summary: Call-time pass-by-reference is when you use the reference operator & on the
input of a function parameter. For example:

```
$arr = array(1, 2, 3);
array_shift(&$arr);
```

This was deprecated in PHP 5.3 and causes a fatal in 5.4. In PHP 7 this is a
parser error according to https://3v4l.org/W6oDd This is a fatal in HHVM as well.

This diff makes call-time pass-by-reference a parser error in Hack as well

Reviewed By: achow, dabek

Differential Revision: D2566300

fb-gh-sync-id: d3cafea1c15953a05cb479dfd4f7c927a6560c47
12 files changed:
hphp/hack/src/h2tp/test/convert_hack_test_inputs_base.py
hphp/hack/src/parsing/parser_hack.ml
hphp/hack/src/utils/errors.ml
hphp/hack/src/utils/errors.mli
hphp/hack/test/typecheck/references/call_time_reference1.php [new file with mode: 0644]
hphp/hack/test/typecheck/references/call_time_reference1.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/references/call_time_reference1.php.no_format [new file with mode: 0644]
hphp/hack/test/typecheck/references/call_time_reference2.php [new file with mode: 0644]
hphp/hack/test/typecheck/references/call_time_reference2.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/references/call_time_reference3.php [new file with mode: 0644]
hphp/hack/test/typecheck/references/call_time_reference3.php.exp [new file with mode: 0644]
hphp/hack/test/typecheck/references/call_time_reference3.php.no_format [new file with mode: 0644]