From c1ac9431861d5e2333c50c4771e96f46e1a3f915 Mon Sep 17 00:00:00 2001 From: Alexey Toptygin Date: Mon, 22 Oct 2018 22:12:28 -0700 Subject: [PATCH] Replace usage of fun for testing param coercion with new intrinsic. Summary: We don't have fun() any more, but I needed a builtin like it to test the VerifyParamFail fixes. Make a new intrinsic in __hhvm_intrinsics that works just like fun did and use it instead. Reviewed By: mofarrell Differential Revision: D10501794 fbshipit-source-id: b6b6eddcff3e4873acbf0d909a02f37daa985423 --- hphp/runtime/ext/std/ext_std_intrinsics.php | 5 +++++ hphp/test/slow/builtin_param_coercion.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hphp/runtime/ext/std/ext_std_intrinsics.php b/hphp/runtime/ext/std/ext_std_intrinsics.php index 75b1d1d4fbc..1bfa70674fe 100644 --- a/hphp/runtime/ext/std/ext_std_intrinsics.php +++ b/hphp/runtime/ext/std/ext_std_intrinsics.php @@ -46,4 +46,9 @@ function serialize_keep_dvarrays(mixed $value): string; <<__Native, __ParamCoerceModeFalse>> function deserialize_keep_dvarrays(string $str): mixed; +/* dummy builtin written in hack for testing param coercion */ +function id_string(string $value): string { + return $value; +} + } diff --git a/hphp/test/slow/builtin_param_coercion.php b/hphp/test/slow/builtin_param_coercion.php index 5a9aa6c99a5..7548b0fa16c 100644 --- a/hphp/test/slow/builtin_param_coercion.php +++ b/hphp/test/slow/builtin_param_coercion.php @@ -4,5 +4,5 @@ class C { public function __toString() { return "lol"; } } <<__EntryPoint>> function test() { - var_dump(fun(new C())); + var_dump(__hhvm_intrinsics\id_string(new C())); } -- 2.11.4.GIT