Arquivos
hhvm/hphp/test/quick/resource.php
T
Alok Menghrajani 7202c3d569 Rename the magic "__resource" class to "resource"
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
2013-08-29 11:58:28 -07:00

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);