diff --git a/composer.json b/composer.json index 0fd2f70..334236d 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": ">=7.1.0", + "php": ">=7.3.0", "ext-pcntl": "*", "ext-posix": "*", "ext-sysvsem": "*", diff --git a/src/ProcessDetailsCollection.php b/src/ProcessDetailsCollection.php index e34630b..4068e66 100644 --- a/src/ProcessDetailsCollection.php +++ b/src/ProcessDetailsCollection.php @@ -122,7 +122,8 @@ public function takeFreeProcess() : ?ProcessDetails { if ($this->getFreeProcessesCount() === 0) { return NULL; } - $freePid = array_shift($this->freeProcessIds); + $freePid = array_key_first($this->freeProcessIds); + unset($this->freeProcessIds[$freePid]); if ($freePid === NULL) { return NULL; }