php8.5
Home/ Manual/ info / functions/ cli_get_process_title

cli_get_process_title

PHP function Edit on GitHub ✎

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

Returns the current process title

Description

cli_get_process_title(): string|null

Returns the current process title, as set by cli_set_process_title(). Note that this may not exactly match what is shown in ps or top, depending on your operating system.

This function is available only in CLI mode.

Parameters Parameters

Return Values

Return a string with the current process title or null on error.

Errors/Exceptions

An E_WARNING will be generated if the operating system is unsupported.

Examples

cli_get_process_title() example

php
<?php
echo "Process title: " . cli_get_process_title() . "\n";
?>

See Also

Source: reference/info/functions/cli-get-process-title.xml · from the official PHP manual (php/doc-en)