WordPress Version: 6.5
/**
* Reads bytes and advances the stream position by the same count.
*
* @param stream $handle Bytes will be read from this resource.
* @param int $num_bytes Number of bytes read. Must be greater than 0.
* @return binary string|false The raw bytes or false on failure.
*/
function read($handle, $num_bytes)
{
$data = fread($handle, $num_bytes);
return ($data !== false && strlen($data) >= $num_bytes) ? $data : false;
}