Hello
> function return types should not depend on the outside context (spawn, hook,
> ini, etc.) because when the code gets more complex, it's very hard to find
> the outside context.
What does “outside context” mean?
I just want to understand the practical use of functions with Promise.
The code above makes sense only if there is awaitAll.
$promise1 = file_get_content_async("file1.txt");
$promise2 = file_get_content_async("file2.txt");
$promise3 = file_get_content_async("file3.txt");
awaitAll($promise1, ....);
But you can achieve exactly the same effect without special functions.
The only difference is that the _async function inside might be
optimized in some way.
Or is there something else?
---
Ed