Skip to content

Commit

Permalink
minor adjustments on examples
Browse files Browse the repository at this point in the history
Signed-off-by: Demin Yin <deminy@deminy.net>
  • Loading branch information
deminy committed Dec 14, 2023
1 parent 0f65c6c commit da9f7c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/csp/coroutines/creation-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ public function __invoke(int $i): void

run(function () {
// Type 1: A simple callback function defined directly within the code block.
Coroutine::create(function () {echo 1; });
Coroutine::create(
function (int $i): void {
echo $i;
},
1
);

// Type 2: A simple callback function defined somewhere previously.
Coroutine::create('callbackFunction', 2);
Expand Down

0 comments on commit da9f7c2

Please sign in to comment.