php-traits icon indicating copy to clipboard operation
php-traits copied to clipboard

inconsistent callables

Open codemasher opened this issue 7 years ago • 0 comments

https://wiki.php.net/rfc/consistent_callables

function foo(callable $callable){
  // ...
}

foo('trim'); // -> Argument 1 passed to foo() must be callable, string given

foo([$obj, 'method']); // -> Argument 1 passed to foo() must be callable, array given

Both cases work fine on PHP 7.2/Windows, but break on linux.

codemasher avatar Jan 22 '18 22:01 codemasher