1 | <?php |
||
12 | class ParentRuntime |
||
13 | { |
||
14 | /** @var bool */ |
||
15 | protected static $isInitialised = false; |
||
16 | |||
17 | /** @var string */ |
||
18 | protected static $autoloader; |
||
19 | |||
20 | /** @var string */ |
||
21 | protected static $childProcessScript; |
||
22 | |||
23 | protected static $currentId = 0; |
||
24 | |||
25 | protected static $myPid = null; |
||
26 | |||
27 | public static function init(string $autoloader = null) |
||
47 | |||
48 | /** |
||
49 | * @param \Spatie\Async\Task|callable $task |
||
50 | * |
||
51 | * @return \Spatie\Async\ParallelProcess |
||
52 | */ |
||
53 | public static function createChildProcess($task): ParallelProcess |
||
68 | |||
69 | /** |
||
70 | * @param \Spatie\Async\Task|callable $task |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | public static function encodeTask($task): string |
||
82 | |||
83 | public static function decodeTask(string $task) |
||
87 | |||
88 | protected static function getId(): string |
||
98 | } |
||
99 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: