7202c3d569
www engineers would like to be able to provide the type for code which takes a resource as input. This simple change is a first step in the right direction. In the future, we might want to provide a way to specific the exact type of resource (e.g. PlainFile vs CurlHandle). Differential Revision: D873115
17 linhas
196 B
PHP
17 linhas
196 B
PHP
<?php
|
|
|
|
class Foo{}
|
|
|
|
function f(resource $r) {
|
|
}
|
|
|
|
$r = STDIN;
|
|
var_dump($r);
|
|
var_dump($r instanceof resource);
|
|
f($r);
|
|
|
|
$foo = new Foo();
|
|
var_dump($foo);
|
|
var_dump($foo instanceof resource);
|
|
f($foo);
|