-
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.
* fix bug #4657 * test * test * test * optimize code * test
- Loading branch information
1 parent
363e681
commit 8b06297
Showing
2 changed files
with
124 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--TEST-- | ||
swoole_runtime: bug 4657 | ||
--SKIPIF-- | ||
<?php | ||
require __DIR__ . '/../include/skipif.inc'; | ||
if(PHP_VERSION_ID < 80000) { | ||
skip_unsupported('php version is too low'); | ||
} | ||
?> | ||
--FILE-- | ||
<?php | ||
use Socket as BaseSocket; | ||
use Swoole\Coroutine\Socket; | ||
use function Swoole\Coroutine\run; | ||
|
||
$socket = socket_create(AF_INET, SOCK_STREAM, 0); | ||
var_dump($socket); | ||
|
||
run(function () { | ||
$socket = socket_create(AF_INET, SOCK_STREAM, 0); | ||
var_dump($socket); | ||
var_dump($socket instanceof BaseSocket); | ||
}); | ||
|
||
$socket = socket_create(AF_INET, SOCK_STREAM, 0); | ||
var_dump($socket); | ||
?> | ||
--EXPECTF-- | ||
object(Socket)#%d (%d) { | ||
} | ||
object(Swoole\Coroutine\Socket)#%d (%d) { | ||
["fd"]=> | ||
int(%d) | ||
["domain"]=> | ||
int(%d) | ||
["type"]=> | ||
int(%d) | ||
["protocol"]=> | ||
int(%d) | ||
["errCode"]=> | ||
int(0) | ||
["errMsg"]=> | ||
string(0) "" | ||
} | ||
bool(true) | ||
object(Socket)#%d (%d) { | ||
} |