proc_nice()

proc_nice() — Change the priority of the current process.

Built-in function of PHP 8.5. The manual lists it as available in PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

What it does

proc_nice() changes the priority of the current process by the amount specified in priority. A positive priority will lower the priority of the current process, whereas a negative priority will raise the priority.

Signature

proc_nice(int $priority): bool

Parameters

ParameterTypeWhat it takes
$priorityintThe new priority value, the value of this may differ on platforms.

Return value

Returns true on success or false on failure. If an error occurs, like the user lacks permission to change the priority, an error of level E_WARNING is also generated.

Example

A runnable snippet:

// Highest priority proc_nice(-20);

Changelog

VersionChange
7.2.0This function is now available on Windows.

All PHP 8.5 built-in functions

Reference card built from the PHP manual page proc_nice() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.