代码都是直接从readme里面取的,稍微调整了一下,server正常,client报错了
server
<?php require_once('hprosesrc\Hprose.php');
function hello($name) {
return 'Hello ' . $name;
}
$server = new HproseHttpServer();
$server->addFunction('hello');
$server->start();
<?php require_once('hprosesrc\Hprose.php');
$client = new HproseHttpClient('http://127.0.0.1/helloserver.php');
echo $client->equire_once('hprosesrc\Hprose.php');
$client = new HproseHttpClient('http://127.0.0.1/helloserver.php');
echo $client->
<p>client</p>
<pre><code>
<?php require_once('hprosesrc\Hprose.php');
$client = new HproseHttpClient('http://127.0.0.1/helloserver.php');
echo $client->hello('World');
Object of class Hprose\Future could not be converted to string
of class Hprose\Future could not be converted to string
错误提示
Object of class Hprose\Future could not be converted to string
环境是windows php5.4.16
该提问来源于开源项目:hprose/hprose-php