Don't raise warning when converting fun() pointer to bool
commitf693dffb1629c47ff932fa0ad3914e0ffaf17059
authorMike Qian <mqian@fb.com>
Wed, 11 Mar 2020 21:12:24 +0000 (11 14:12 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 11 Mar 2020 21:20:03 +0000 (11 14:20 -0700)
tree94829302ca963b6ab4e8f9a84aaa99a0fa1010c7
parent7daebb4ec4b8342559c7eab53f8d1a9512d95cca
Don't raise warning when converting fun() pointer to bool

Summary:
Always consider a fun() pointer to be truthy. This matches the current behavior of strings that are valid PHP identifiers and is not scheduled to change, so don't raise a warning. The same goes for class pointers.

Also make some warning messages consistent between jit and interp.

Reviewed By: billf

Differential Revision: D20203610

fbshipit-source-id: 3d3c4ada5cdbb61a0927f75f2545f286d9b4c87c
12 files changed:
hphp/runtime/base/tv-comparisons.cpp
hphp/runtime/base/tv-conversions-inl.h
hphp/runtime/base/tv-conversions.cpp
hphp/runtime/base/type-variant.cpp
hphp/runtime/base/type-variant.h
hphp/runtime/vm/func-inl.h
hphp/runtime/vm/func.h
hphp/runtime/vm/jit/simplify.cpp
hphp/test/slow/func-ptr/cast-notice.php [new file with mode: 0644]
hphp/test/slow/func-ptr/cast-notice.php.expect [new file with mode: 0644]
hphp/test/slow/func-ptr/cast-notice.php.hphp_opts [new file with mode: 0644]
hphp/test/slow/func-ptr/cast-notice.php.opts [new file with mode: 0644]