-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
106 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--TEST-- | ||
swoole_coroutine: exit | ||
--SKIPIF-- | ||
<?php require __DIR__ . '/../include/skipif.inc'; | ||
skip_if_php_version_lower_than('8.4'); | ||
?> | ||
--FILE-- | ||
<?php | ||
require __DIR__ . '/../include/bootstrap.php'; | ||
require TESTS_API_PATH . '/exit.php'; | ||
?> | ||
--EXPECTF-- | ||
int(1) | ||
string(4) "exit" | ||
int(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--TEST-- | ||
swoole_coroutine: exit exception backtrace | ||
--SKIPIF-- | ||
<?php require __DIR__ . '/../include/skipif.inc'; | ||
skip_if_php_version_lower_than('8.4'); | ||
?> | ||
--FILE-- | ||
<?php | ||
require __DIR__ . '/../include/bootstrap.php'; | ||
function foo() | ||
{ | ||
bar(get_safe_random()); | ||
} | ||
|
||
function bar(string $random) | ||
{ | ||
char(mt_rand(0, PHP_INT_MAX)); | ||
} | ||
|
||
function char(int $random) | ||
{ | ||
exit; | ||
} | ||
|
||
go(function () { | ||
co::sleep(0.001); | ||
}); | ||
go(function () { | ||
foo(); | ||
}); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught Swoole\ExitException: swoole exit in %s:%d | ||
Stack trace: | ||
#0 %s(%d): exit() | ||
#1 %s(%d): char(%d) | ||
#2 %s(%d): bar('%s') | ||
#3 %s(%d): foo() | ||
#4 [internal function]: {closure:%s:%d}() | ||
#5 {main} | ||
thrown in %s on line %d | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters