Skip to content

Instantly share code, notes, and snippets.

View shuchkin's full-sized avatar
🏠
Working from home

Sergey Shuchkin shuchkin

🏠
Working from home
View GitHub Profile
@shuchkin
shuchkin / pid2proc.php
Last active November 24, 2020 21:07
Extract process name by PID
/**
* Get process by pid Windows|Linux
*
* @param int $pid PID or 0 to reset cache
* @param bool $disable_cache Disable cache for extracted process list (very slow)
*
* @return false|string
*/
function pid2proc( int $pid = 0, $disable_cache = false ) {
static $cache;