1 | <?php |
||
15 | class ParentRuntime |
||
16 | { |
||
17 | /** @var bool */ |
||
18 | protected static $isInitialised = false; |
||
19 | |||
20 | /** @var string */ |
||
21 | protected static $autoloader; |
||
22 | |||
23 | /** @var string */ |
||
24 | protected static $childProcessScript; |
||
25 | |||
26 | protected static $currentId = 0; |
||
27 | |||
28 | protected static $myPid = null; |
||
29 | |||
30 | public static function init(string $autoloader = null) |
||
50 | |||
51 | /** |
||
52 | * @param \Spatie\Async\Task|callable $task |
||
53 | * @param int|null $outputLength |
||
54 | * |
||
55 | * @param string $binary |
||
56 | * @return \Spatie\Async\Process\Runnable |
||
57 | */ |
||
58 | public static function createProcess($task, ?int $outputLength = null, string $binary = Pool::DEFAULT_PHP_BINARY): Runnable |
||
72 | |||
73 | public static function createProcessExecutable($task, ?int $outputLength = null, string $binary = Pool::DEFAULT_PHP_BINARY): Process |
||
83 | |||
84 | /** |
||
85 | * @param \Spatie\Async\Task|callable $task |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | public static function encodeTask($task): string |
||
97 | |||
98 | public static function decodeTask(string $task) |
||
102 | |||
103 | protected static function getId(): string |
||
113 | } |
||
114 |
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: