-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Conversation
@@ -3168,8 +3168,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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 $foo[] = $x
, see
Line 1971 in 0038db2
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied"); |
$foo[] = $x
and array_push($foo, $x)
.
59b3ab9
to
8f780ab
Compare
Appveyor failure seems unrelated. |
2a753b9
to
7680d5b
Compare
This probably needs to wait the result of the Reclassifying Engine Warnings RFC. |
That RFC has been accepted (this issue should trigger an |
Merged as 1ca4ab0. |
Split from #4566