php8.5
Home/ Manual/ stomp / functions/ stomp_connect_error

stomp_connect_error

PHP function Edit on GitHub ✎

(PECL stomp >= 0.3.0)

Returns a string description of the last connect error

Description

stomp_connect_error(): string

Returns a string description of the last connect error.

Parameters Parameters

Return Values

A string that describes the error, or null if no error occurred.

Examples

stomp_connect_error() example

php
<?php
$link = stomp_connect('http://localhost:61613');

if(!$link) {
    die('Connection failed: ' . stomp_connect_error());
}
?>

The above example will output something similar to:

output
Connection failed: Invalid Broker URI scheme

Source: reference/stomp/functions/stomp-connect-error.xml · from the official PHP manual (php/doc-en)