Skip to content

Improve array to string conversion #991

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ Standard library changes
. Added hybrid sorting algo zend_sort for better performance.
. Added stable sorting algo zend_insert_sort.
. Removed dl() function on fpm-fcgi.
. Array to string conversion now raises E_RECOVERABLE_ERROR, instead of previous
E_NOTICE.

Other
=====
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ ZEND_API void ZEND_FASTCALL _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{
break;
}
case IS_ARRAY:
zend_error(E_NOTICE, "Array to string conversion");
zend_error(E_RECOVERABLE_ERROR,"Array to string conversion");
zval_dtor(op);
ZVAL_NEW_STR(op, zend_string_init("Array", sizeof("Array")-1, 0));
break;
Expand Down Expand Up @@ -781,7 +781,7 @@ ZEND_API zend_string* ZEND_FASTCALL _zval_get_string_func(zval *op) /* {{{ */
return zend_strpprintf(0, "%.*G", (int) EG(precision), Z_DVAL_P(op));
}
case IS_ARRAY:
zend_error(E_NOTICE, "Array to string conversion");
zend_error(EG(exception) ? E_ERROR : E_RECOVERABLE_ERROR, "Array to string conversion");
return zend_string_init("Array", sizeof("Array")-1, 0);
case IS_OBJECT: {
zval tmp;
Expand Down