facebook/hhvm — pull request #4320 by kevinxucs (2014-11-22 21:17:15+00:00)
Title: Implemented UserFile file descriptor casting.

Implemented UserFile file descriptor casting by calling user defined
function streamWrapper::stream_cast(int). Also in the function which
converts File* to file descriptor, checks whether the casting function
fd() returns -1, raise warning if so. Finally after all the castings for
read / write / except array are done, check whether any file descriptors
are successfully casted, if not, raise warning and return false.

Passing vfsstream selectStream test.