Add eval mode to hhvm binary and use it in php_wrapper to implement -r
commit9017fb78fc206006304a24b7c193e0e4974ab1d8
authorPaul Bissonnette <paulbiss@fb.com>
Wed, 10 Jun 2020 04:32:17 +0000 (9 21:32 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 10 Jun 2020 04:35:02 +0000 (9 21:35 -0700)
tree7d59d650b9678b49bc780d3ed9b1d0aa214c8d91
parentbd59bca6a17eade1f4e2cbb2555a02e5583ddb5d
Add eval mode to hhvm binary and use it in php_wrapper to implement -r

Summary: We want to lift top level code from `php -r <code>` into an `__EntryPoint` function so that users don't need to write out the function by hand once top level code is banned. We already do this for the debugger REPL, so add a new mode to hhvm to run a string as a debugger eval string and use it in php_wrapper.

Reviewed By: oulgen, jano

Differential Revision: D21957992

fbshipit-source-id: 222027a987838da3c2c78b6862a86653559fae49
hphp/runtime/base/execution-context.cpp
hphp/runtime/base/program-functions.cpp
hphp/test/quick/mode-eval.php [new file with mode: 0644]
hphp/test/quick/mode-eval.php.expect [new file with mode: 0644]
hphp/test/quick/mode-eval.php.norepo [new file with mode: 0644]