« Yar_Client::__construct
Yar_Client::setOpt »

Yar_Client::getOpt

(PECL yar >= 1.1.0)

Yar_Client::getOpt — Read a client option

説明

public function Yar_Client::getOpt(int $name): mixed

Returns the value previously set with Yar_Client::setOpt(), or with the options parameter of Yar_Client::__construct().

パラメータ

name

One of the YAR_OPT_* constants, see Yar_Client::setOpt().

戻り値

The option value, or false if the option has not been set on this client or the option name is unknown.

例

例1 Yar_Client::getOpt() example

<?php
$client = new Yar_Client("http://api.example.com/operator.php");
$client->setOpt(YAR_OPT_TIMEOUT, 1000);

var_dump($client->getOpt(YAR_OPT_TIMEOUT));
var_dump($client->getOpt(YAR_OPT_PACKAGER));
?>

上の例の出力は、 たとえば以下のようになります。

int(1000)
bool(false)

参考

関連キーワード:
Client   client   option   getOpt   setOpt   construct   dump   mixed   parameter   constants   operator
関連する関数・ページ:
yar-client.setopt   yar-client.construct   class.yar-client   mysql-xdevapi-client.construct   yar-client-exception.gettype   swoole-client.destruct