streamfd

A simple PHP extension that allows to get the FD of a stream resource

MIT License

Stars
5

streamfd

A simple PHP extension that allows you to get the FD of a stream resource.

Building

git clone https://github.com/Encritary/streamfd.git
cd streamfd
phpize
./configure --enable-streamfd
make && make test && sudo make install

Usage

The extension adds only one new PHP function:

streamfd(resource $stream) : int|bool

It will return the file descriptor (a positive integer) of the given stream resource, or false if an error occurs.