Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<pcntl_get_last_errorpcntl_getcpuaffinity>
^PCNTL FunctionsLast updated: Mon, 26 Oct 2026

pcntl_getcpu

(PHP 8 >= 8.4.0)

pcntl_getcpu — Get the CPU number on which the calling process last executed

Description

function pcntl_getcpu(): int

pcntl_getcpu() returns the number of the CPU on which the calling process was last executed. This function uses the sched_getcpu(3) system call available on Linux.

Parameters

This function has no parameters.

Return Values

Returns the CPU number as an int.

See Also


<pcntl_get_last_errorpcntl_getcpuaffinity>
^PCNTL FunctionsLast updated: Mon, 26 Oct 2026