Calls to PHP builtins from Hack files shouldnt have PHP7 strict parameter type enforcment
commit939de4bcd714c26c8311f089156c31e40b097f83
authorFred Emmott <fe@fb.com>
Wed, 14 Mar 2018 20:16:15 +0000 (14 13:16 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 14 Mar 2018 20:40:58 +0000 (14 13:40 -0700)
tree9bd5d0ea99d13b3cf8d67aeede6b18e37e5fb51e
parentce661389bbdd655979fe3a0760df7a7152e7535b
Calls to PHP builtins from Hack files shouldnt have PHP7 strict parameter type enforcment

Summary:
This has nothing to do with `<?hh // strict`, just the runtime behavior.

There are effectively 3 modes:
 - standard PHP behavior: coerce and warn
 - PHP7 `declare(strict_types=1)` behavior: raise TypeErrors
 - Hack files with PHP7 mode enabled:
   - use strict_types=1 behavior when calling user functions
   - use strict_types=0 behavior when calling builtins: this is because the HHIs aren't restrictive enough, and enforcing it is a really bad experience. This will probably be resolved by releasing the `PHP\` wrappers.

This was correctly done when using the interpreter without using HackC.

The JIT currently considered the second and third cases to be the same.

This diff:
 - corrects the JIT
 - fixes the assembler (for when using HackC)
 - does a tiny no-op change to a helper which makes stepping through in gdb more intuitive

Reviewed By: markw65

Differential Revision: D7201617

fbshipit-source-id: 75be7b400bfaa7b221fab07aa0a5f5bb92c16abe
hphp/runtime/vm/as.cpp
hphp/runtime/vm/jit/irlower-act-rec.cpp
hphp/runtime/vm/jit/translator-runtime.cpp
hphp/test/slow/php7_bcbreak/hack_strict_builtins.php [new file with mode: 0644]
hphp/test/slow/php7_bcbreak/hack_strict_builtins.php.expectf [new file with mode: 0644]
hphp/test/slow/php7_bcbreak/hack_strict_builtins.php.ini [new file with mode: 0644]