We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
namespace App\Http\Controllers;
use Hprose\Http\Server;
class Test { public function index() { $server = new Server(); $server->addFunction('hello'); $server->start();
} function hello($name) { return "Hello $name!"; }
}
Exception Argument func must be callable.
The text was updated successfully, but these errors were encountered:
你的hello是个方法,不是个单独的函数,所以不能用 addFunction('hello') 的方式。要用 addFunction([$this, 'hello']) 这种方式。
Sorry, something went wrong.
3.0 addFunction 换成 addCallable 就行了。
No branches or pull requests
namespace App\Http\Controllers;
use Hprose\Http\Server;
class Test
{
public function index()
{
$server = new Server();
$server->addFunction('hello');
$server->start();
}
Exception
Argument func must be callable.
The text was updated successfully, but these errors were encountered: