return;
}
+ if (ZEND_NUM_ARGS() == 5 && maxlen < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater than or equal to zero");
+ RETURN_FALSE;
+ }
+
context = php_stream_context_from_zval(zcontext, 0);
stream = php_stream_open_wrapper_ex(filename, "rb",
RETURN_FALSE;
}
- if (maxlen < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length must be greater than or equal to zero");
- RETURN_FALSE;
- }
-
if (offset > 0 && php_stream_seek(stream, offset, SEEK_SET) < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to seek to position %ld in the stream", offset);
php_stream_close(stream);