From f77a4ad9f7d0e84ee418165c4c9a604ea89780f9 Mon Sep 17 00:00:00 2001 From: Stanley Cheung <stanleycheung@google.com> Date: Tue, 16 Feb 2016 09:45:51 -0800 Subject: [PATCH] channel constructor the array is required --- src/php/ext/grpc/channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c index 97e8cc1a63..2c64b9122c 100644 --- a/src/php/ext/grpc/channel.c +++ b/src/php/ext/grpc/channel.c @@ -141,8 +141,8 @@ PHP_METHOD(Channel, __construct) { HashTable *array_hash; zval **creds_obj = NULL; wrapped_grpc_channel_credentials *creds = NULL; - /* "s|a" == 1 string, 1 optional array */ - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|a", &target, + /* "sa" == 1 string, 1 array */ + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sa", &target, &target_length, &args_array) == FAILURE) { zend_throw_exception(spl_ce_InvalidArgumentException, "Channel expects a string and an array", 1 TSRMLS_CC); -- GitLab