Warn when first arg to call_user_func is an object with no __invoke
commit09dbe0ba3e892f356f00c9cb27d803453b6e1e51
authorOwen Yamauchi <oyamauchi@fb.com>
Wed, 12 Feb 2014 22:30:40 +0000 (12 14:30 -0800)
committerSara Golemon <sgolemon@fb.com>
Thu, 13 Feb 2014 16:36:44 +0000 (13 08:36 -0800)
tree9cf6b1e1825cf118b4b45690be8e5bffeab80b72
parent0bb20b8f76d208937d2650fb06ac9bd41d2d93c8
Warn when first arg to call_user_func is an object with no __invoke

Slight non-optimality: the message should say call_user_func_array if
you're making this mistake with that function, but that would take a
little extra effort (looking at the active VM frame) and we're already
getting it wrong in other situations.

The error message doesn't match PHP, which says "no array or string
given". I'm going for more information rather than perfect matching.

Reviewed By: @ptarjan

Differential Revision: D1170508
hphp/runtime/base/builtin-functions.cpp
hphp/test/quick/cuf-warning.php [new file with mode: 0644]
hphp/test/quick/cuf-warning.php.expectf [new file with mode: 0644]