they wrap the PHP resources, as expected, but a raw FD is extracted
from them
the FDs are sequential
they work the same as for standalone CLI mode, including STDERR
redirection
HTTP Server
$ curl http://localhost:8080/test.hack
object(HH\Lib\_Private\_IO\RequestReadHandle) (2) {
["isAwaitable":protected]=>
bool(true)
["impl":protected]=>
resource(4) of type (stream)
}
object(HH\Lib\_Private\_IO\ResponseWriteHandle) (2) {
["isAwaitable":protected]=>
bool(true)
["impl":protected]=>
resource(5) of type (stream)
}
NULL
Read from in: ''
Writing to out
Hello,
Writing to error
input/output do not have a FileDescriptor - pure PHP resources.
error is null (expected)
no error output, nullsafe call
input is empty, GET request
Request Input
$ curl -d herpderp http://localhost:8080/test.hack
object(HH\Lib\_Private\_IO\RequestReadHandle) (2) {
["isAwaitable":protected]=>
bool(true)
["impl":protected]=>
resource(4) of type (stream)
}
object(HH\Lib\_Private\_IO\ResponseWriteHandle) (2) {
["isAwaitable":protected]=>
bool(true)
["impl":protected]=>
resource(5) of type (stream)
}
NULL
Read from in: 'herpderp'
Writing to out
Hello,
Writing to error
Non-CLI handles are still using PHP resources, as the replacements are not yet available in FB builds of HHVM.
Test Plan:
Standalone CLI
STDOUT vs STDERR
CLI Server
OS\FileDescriptor
objects are still usedHTTP Server
Request Input
request_input()