略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Yar_Client::__call

2024-04-28

Yar_Client::__call

(PECL yar >= 1.0.0)

Yar_Client::__call调用远程服务

说明

public Yar_Client::__call(string $method, array $parameters): void

发起一个RPC调用, 并且得到返回值. 如果服务端的远程调用抛出异常, 那么本地也会相应的抛出一个Yar_Server_Exception异常.

参数

method

远程服务的名字.

parameters

调用参数.

返回值

范例

示例 #1 Yar_Client::__call() example

<?php

$client 
= new Yar_Client("http://host/api/");

/* 调用远程服务的some_method服务 */
$result $client->some_method("parameter");

?>

以上例程的输出类似于:

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/yar-client.call.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3