- 创建了 resource.php 示例文件 - 定义了接受 resource 类型参数的函数 foo - 实现了通过 fopen 打开 stdin 流的功能 - 添加了主函数调用演示 resource 参数传递pull/1/head
parent
2b088d71c5
commit
817c056859
1 changed files with 11 additions and 0 deletions
@ -0,0 +1,11 @@ |
|||||||
|
<?php |
||||||
|
function foo(resource $res) |
||||||
|
{ |
||||||
|
var_dump($res); |
||||||
|
|
||||||
|
} |
||||||
|
function main() |
||||||
|
{ |
||||||
|
$stream = fopen("php://stdin", "r"); |
||||||
|
foo($stream); |
||||||
|
} |
||||||
Loading…
Reference in new issue