php8.5
Home/ Manual/ yar / yar_client/ Yar_Client::getOpt

Yar_Client::getOpt

PHP function Edit on GitHub ✎

(PECL yar >= 1.1.0)

Read a client option

Description

Yar_Client::getOpt(int $name): mixed

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

Parameters

name

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

Return Values

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

Examples

Yar_Client::getOpt example

php
<?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));
?>

The above example will output something similar to:

output
int(1000)
bool(false)

See Also

  • Yar_Client::setOpt

Source: reference/yar/yar_client/getopt.xml · from the official PHP manual (php/doc-en)