diff options
author | George Peter Banyard <girgias@php.net> | 2019-08-21 02:27:27 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-10-02 10:38:23 +0200 |
commit | 1ca4ab09a584b5e3c7caf4466fbb435991c7000b (patch) | |
tree | f598144f4587c67417bee316f9662d4e3982db8d /ext/standard/array.c | |
parent | 2f92957fd3d8d87e73013c016e479451db0c6a1e (diff) | |
download | php-git-1ca4ab09a584b5e3c7caf4466fbb435991c7000b.tar.gz |
Promote warnings to errors in array_push()
This is in line with the engine change from
https://wiki.php.net/rfc/engine_warnings.
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r-- | ext/standard/array.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index c0ea7e1729..96f9eb4893 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -3152,7 +3152,7 @@ static void php_splice(HashTable *in_hash, zend_long offset, zend_long length, H } /* }}} */ -/* {{{ proto int|false array_push(array stack, mixed var [, mixed ...]) +/* {{{ proto int array_push(array stack, mixed var [, mixed ...]) Pushes elements onto the end of the array */ PHP_FUNCTION(array_push) { @@ -3174,8 +3174,8 @@ PHP_FUNCTION(array_push) if (zend_hash_next_index_insert(Z_ARRVAL_P(stack), &new_var) == NULL) { Z_TRY_DELREF(new_var); - php_error_docref(NULL, E_WARNING, "Cannot add element to the array as the next element is already occupied"); - RETURN_FALSE; + zend_throw_error(NULL, "Cannot add element to the array as the next element is already occupied"); + return; } } |