if (str_len == 4) {
if (!strcasecmp(str.s, "null")) {
+ /* We need to explicitly clear the error because its an actual NULL and not an error */
+ jp->error_code = PHP_JSON_ERROR_NONE;
RETVAL_NULL();
} else if (!strcasecmp(str.s, "true")) {
RETVAL_BOOL(1);
RETVAL_DOUBLE(d);
}
}
+
+ if (Z_TYPE_P(return_value) != IS_NULL) {
+ jp->error_code = PHP_JSON_ERROR_NONE;
+ }
}
else
{
if (str_len == 4) {
if (ZEND_U_CASE_EQUAL(IS_UNICODE, str, str_len, "null", sizeof("null")-1)) {
+ /* We need to explicitly clear the error because its an actual NULL and not an error */
+ jp->error_code = PHP_JSON_ERROR_NONE;
RETVAL_NULL();
} else if (ZEND_U_CASE_EQUAL(IS_UNICODE, str, str_len, "true", sizeof("true")-1)) {
RETVAL_BOOL(1);
RETVAL_DOUBLE(d);
}
}
+
+ if (Z_TYPE_P(return_value) != IS_NULL) {
+ jp->error_code = PHP_JSON_ERROR_NONE;
+ }
}
FREE_ZVAL(z);