cast $mode arg from stream_set_blocking call to integer