Closed ghost closed 5 years ago
PHP does not re-use numeric integers. If we wanted to re-use IDs we'd have to make our own management for this. The only numeric key PHP re-uses is the PHP_INT_MAX
, but only if the key is not already present, otherwise an error will be thrown.
This PR changes the file descriptor from the array size to random bytes. Compatibility is guaranteed through random_compat, although PHP5 support is running out in one month.
Using random bytes guarantees no clashing file descriptors, that means re-using and overwriting a currently active file descriptor.