Jelajahi Sumber

php7.4 declare(strict_types=1); TypeError: posix_kill() expects parameter 1 to be int, string given

万少波 4 tahun lalu
induk
melakukan
6f8c15b4c0
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      Worker.php

+ 2 - 2
Worker.php

@@ -981,7 +981,7 @@ class Worker
                 $start_time = \time();
                 // Check master process is still alive?
                 while (1) {
-                    $master_is_alive = $master_pid && \posix_kill($master_pid, 0);
+                    $master_is_alive = $master_pid && \posix_kill((int) $master_pid, 0);
                     if ($master_is_alive) {
                         // Timeout?
                         if (!static::$_gracefulStop && \time() - $start_time >= $timeout) {
@@ -2562,7 +2562,7 @@ class Worker
             return false;
         }
 
-        $master_is_alive = $master_pid && \posix_kill($master_pid, 0) && \posix_getpid() !== $master_pid;
+        $master_is_alive = $master_pid && \posix_kill((int) $master_pid, 0) && \posix_getpid() !== $master_pid;
         if (!$master_is_alive) {
             return false;
         }