diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 5579aeb978e..13c345de4dd 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -707,18 +707,20 @@ PHP_FUNCTION(hash_update) /* {{{ Pump data into the hashing algorithm from an open stream */ PHP_FUNCTION(hash_update_stream) { - zval *zhash, *zstream; + zend_object *hash_obj; php_hashcontext_object *hash; php_stream *stream = NULL; zend_long length = -1, didread = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "Or|l", &zhash, php_hashcontext_ce, &zstream, &length) == FAILURE) { - RETURN_THROWS(); - } + ZEND_PARSE_PARAMETERS_START(2, 3) + Z_PARAM_OBJ_OF_CLASS(hash_obj, php_hashcontext_ce) + PHP_Z_PARAM_STREAM(stream) + Z_PARAM_OPTIONAL + Z_PARAM_LONG(length) + ZEND_PARSE_PARAMETERS_END(); - hash = php_hashcontext_from_object(Z_OBJ_P(zhash)); + hash = php_hashcontext_from_object(hash_obj); PHP_HASHCONTEXT_VERIFY(hash); - php_stream_from_zval(stream, zstream); while (length) { char buf[1024];