Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 8.1k
Promote warnings to errors in array_push()#4585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -3151,7 +3151,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) | ||||
| { | ||||
| @@ -3173,8 +3173,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"); | ||||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, this is actually a pretty generic warning, in particular also used by Line 1971 in 0038db2
$foo[] = $x and array_push($foo, $x). | ||||
| return; | ||||
| } | ||||
| } | ||||
Uh oh!
There was an error while loading. Please reload this page.