Lines Matching refs:val

44 static int php_json_determine_array_type(zval *val) /* {{{ */  in php_json_determine_array_type()  argument
46 zend_array *myht = Z_ARRVAL_P(val); in php_json_determine_array_type()
123 static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, php_json_encoder *… in php_json_encode_array() argument
137 if (Z_TYPE_P(val) == IS_ARRAY) { in php_json_encode_array()
138 myht = Z_ARRVAL_P(val); in php_json_encode_array()
141 … = (options & PHP_JSON_FORCE_OBJECT) ? PHP_JSON_OUTPUT_OBJECT : php_json_determine_array_type(val); in php_json_encode_array()
142 } else if (Z_OBJ_P(val)->properties == NULL in php_json_encode_array()
143 && Z_OBJ_HT_P(val)->get_properties_for == NULL in php_json_encode_array()
144 && Z_OBJ_HT_P(val)->get_properties == zend_std_get_properties in php_json_encode_array()
145 && Z_OBJ_P(val)->ce->num_hooked_props == 0 in php_json_encode_array()
146 && !zend_object_is_lazy(Z_OBJ_P(val))) { in php_json_encode_array()
148 zend_object *obj = Z_OBJ_P(val); in php_json_encode_array()
222 zend_object *obj = Z_OBJ_P(val); in php_json_encode_array()
223 prop_ht = myht = zend_get_properties_for(val, ZEND_PROP_PURPOSE_JSON); in php_json_encode_array()
275 if (ZSTR_VAL(key)[0] == '\0' && ZSTR_LEN(key) > 0 && Z_TYPE_P(val) == IS_OBJECT) { in php_json_encode_array()
286 zend_read_property_ex(prop_info->ce, Z_OBJ_P(val), prop_info->name, /* silent */ true, &tmp); in php_json_encode_array()
582 static zend_result php_json_encode_serializable_object(smart_str *buf, zval *val, int options, php_… in php_json_encode_serializable_object() argument
584 zend_class_entry *ce = Z_OBJCE_P(val); in php_json_encode_serializable_object()
585 zend_object *obj = Z_OBJ_P(val); in php_json_encode_serializable_object()
604 …if (FAILURE == call_user_function(NULL, val, &fname, &retval, 0, NULL) || Z_TYPE(retval) == IS_UND… in php_json_encode_serializable_object()
630 (Z_OBJ(retval) == Z_OBJ_P(val))) { in php_json_encode_serializable_object()
647 static zend_result php_json_encode_serializable_enum(smart_str *buf, zval *val, int options, php_js… in php_json_encode_serializable_enum() argument
649 zend_class_entry *ce = Z_OBJCE_P(val); in php_json_encode_serializable_enum()
656 zval *value_zv = zend_enum_fetch_case_value(Z_OBJ_P(val)); in php_json_encode_serializable_enum()
660 zend_result php_json_encode_zval(smart_str *buf, zval *val, int options, php_json_encoder *encoder)… in php_json_encode_zval() argument
663 switch (Z_TYPE_P(val)) in php_json_encode_zval()
677 smart_str_append_long(buf, Z_LVAL_P(val)); in php_json_encode_zval()
681 if (php_json_is_valid_double(Z_DVAL_P(val))) { in php_json_encode_zval()
682 php_json_encode_double(buf, Z_DVAL_P(val), options); in php_json_encode_zval()
690 return php_json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val), options, encoder); in php_json_encode_zval()
693 if (instanceof_function(Z_OBJCE_P(val), php_json_serializable_ce)) { in php_json_encode_zval()
694 return php_json_encode_serializable_object(buf, val, options, encoder); in php_json_encode_zval()
696 if (Z_OBJCE_P(val)->ce_flags & ZEND_ACC_ENUM) { in php_json_encode_zval()
697 return php_json_encode_serializable_enum(buf, val, options, encoder); in php_json_encode_zval()
706 ZVAL_COPY(&zv, val); in php_json_encode_zval()
713 val = Z_REFVAL_P(val); in php_json_encode_zval()