You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
20
vendor/swoole/examples/coroutine/stack.php
vendored
Executable file
20
vendor/swoole/examples/coroutine/stack.php
vendored
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
co::set(['stack_size' => 8192*4]);
|
||||
|
||||
function test($n)
|
||||
{
|
||||
$a = 1;
|
||||
$b = 2;
|
||||
$c = 3;
|
||||
$d = 4;
|
||||
static $i;
|
||||
|
||||
usleep(100000);
|
||||
echo "index=".($i++)."\n";
|
||||
|
||||
return test($n + $a + $b + $c + $d);
|
||||
}
|
||||
|
||||
go(function () {
|
||||
test(9);
|
||||
});
|
Reference in New Issue
Block a user