mirror of
https://github.com/php/php-src.git
synced 2024-11-29 04:46:07 +08:00
MFH: use E_WARNING on recursion and add null to the result to keep it valid
This commit is contained in:
parent
60720d285f
commit
3003cd2473
@ -136,7 +136,8 @@ static void json_encode_array(smart_str *buf, zval **val TSRMLS_DC) {
|
||||
}
|
||||
|
||||
if (myht && myht->nApplyCount > 1) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "recursion detected");
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "recursion detected");
|
||||
smart_str_appendl(buf, "null", 4);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -25,4 +25,6 @@ array(1) {
|
||||
}
|
||||
}
|
||||
|
||||
Catchable fatal error: json_encode(): recursion detected in %s on line %d
|
||||
Warning: json_encode(): recursion detected in %s on line %d
|
||||
string(8) "[[null]]"
|
||||
Done
|
||||
|
@ -22,4 +22,6 @@ object(stdClass)#%d (1) {
|
||||
}
|
||||
}
|
||||
|
||||
Catchable fatal error: json_encode(): recursion detected in %s on line %d
|
||||
Warning: json_encode(): recursion detected in %s on line %d
|
||||
string(22) "{"prop":{"prop":null}}"
|
||||
Done
|
||||
|
@ -22,4 +22,6 @@ array(1) {
|
||||
}
|
||||
}
|
||||
|
||||
Catchable fatal error: json_encode(): recursion detected in %s on line %d
|
||||
Warning: json_encode(): recursion detected in %s on line %d
|
||||
string(8) "[[null]]"
|
||||
Done
|
||||
|
Loading…
Reference in New Issue
Block a user