simplify
authorMichael Wallner <mike@php.net>
Thu, 22 Jan 2015 08:34:35 +0000 (09:34 +0100)
committerMichael Wallner <mike@php.net>
Thu, 22 Jan 2015 08:34:35 +0000 (09:34 +0100)
php_http_env.c

index eef0c37aad541fb1d64ce933d13fd63a3ff2f19c..99ea0e00f4d8732c8ac7261e480d2d8c1f54b5f8 100644 (file)
@@ -957,18 +957,10 @@ static SAPI_POST_HANDLER_FUNC(php_http_json_post_handler)
                        ZVAL_NULL(&tmp);
                        php_json_decode(&tmp, json->val, json->len, 1, PG(max_input_nesting_level));
 
-                       switch (Z_TYPE(tmp)) {
-                       case IS_NULL:
-                               break;
-
-                       case IS_ARRAY:
+                       if (Z_TYPE(tmp) == IS_ARRAY) {
                                array_copy(Z_ARRVAL(tmp), Z_ARRVAL_P(zarg));
-                               zval_ptr_dtor(&tmp);
-                               break;
-
-                       default:
-                               ZVAL_COPY_VALUE(zarg, &tmp);
                        }
+                       zval_ptr_dtor(&tmp);
                }
                zend_string_release(json);
        }