example(error): 添加资源类型参数示例代码

- 创建了 resource.php 示例文件
- 定义了接受 resource 类型参数的函数 foo
- 实现了通过 fopen 打开 stdin 流的功能
- 添加了主函数调用演示 resource 参数传递
pull/1/head
韩天峰 4 months ago
parent 2b088d71c5
commit 817c056859
  1. 11
      examples/error/resource.php

@ -0,0 +1,11 @@
<?php
function foo(resource $res)
{
var_dump($res);
}
function main()
{
$stream = fopen("php://stdin", "r");
foo($stream);
}
Loading…
Cancel
Save