Lines Matching refs:val

34 static int php_json_determine_array_type(zval *val) /* {{{ */  in php_json_determine_array_type()  argument
36 zend_array *myht = Z_ARRVAL_P(val); in php_json_determine_array_type()
106 static int php_json_encode_array(smart_str *buf, zval *val, int options, php_json_encoder *encoder)… in php_json_encode_array() argument
111 if (Z_TYPE_P(val) == IS_ARRAY) { in php_json_encode_array()
112 myht = Z_ARRVAL_P(val); in php_json_encode_array()
114 … = (options & PHP_JSON_FORCE_OBJECT) ? PHP_JSON_OUTPUT_OBJECT : php_json_determine_array_type(val); in php_json_encode_array()
115 } else if (Z_OBJ_P(val)->properties == NULL in php_json_encode_array()
116 && Z_OBJ_HT_P(val)->get_properties_for == NULL in php_json_encode_array()
117 && Z_OBJ_HT_P(val)->get_properties == zend_std_get_properties) { in php_json_encode_array()
119 zend_object *obj = Z_OBJ_P(val); in php_json_encode_array()
194 prop_ht = myht = zend_get_properties_for(val, ZEND_PROP_PURPOSE_JSON); in php_json_encode_array()
234 if (ZSTR_VAL(key)[0] == '\0' && ZSTR_LEN(key) > 0 && Z_TYPE_P(val) == IS_OBJECT) { in php_json_encode_array()
525 static int php_json_encode_serializable_object(smart_str *buf, zval *val, int options, php_json_enc… in php_json_encode_serializable_object() argument
527 zend_class_entry *ce = Z_OBJCE_P(val); in php_json_encode_serializable_object()
528 HashTable* myht = Z_OBJPROP_P(val); in php_json_encode_serializable_object()
544 …if (FAILURE == call_user_function(NULL, val, &fname, &retval, 0, NULL) || Z_TYPE(retval) == IS_UND… in php_json_encode_serializable_object()
570 (Z_OBJ(retval) == Z_OBJ_P(val))) { in php_json_encode_serializable_object()
587 static int php_json_encode_serializable_enum(smart_str *buf, zval *val, int options, php_json_encod… in php_json_encode_serializable_enum() argument
589 zend_class_entry *ce = Z_OBJCE_P(val); in php_json_encode_serializable_enum()
596 zval *value_zv = zend_enum_fetch_case_value(Z_OBJ_P(val)); in php_json_encode_serializable_enum()
600 int php_json_encode_zval(smart_str *buf, zval *val, int options, php_json_encoder *encoder) /* {{{ … in php_json_encode_zval() argument
603 switch (Z_TYPE_P(val)) in php_json_encode_zval()
617 smart_str_append_long(buf, Z_LVAL_P(val)); in php_json_encode_zval()
621 if (php_json_is_valid_double(Z_DVAL_P(val))) { in php_json_encode_zval()
622 php_json_encode_double(buf, Z_DVAL_P(val), options); in php_json_encode_zval()
630 return php_json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val), options, encoder); in php_json_encode_zval()
633 if (instanceof_function(Z_OBJCE_P(val), php_json_serializable_ce)) { in php_json_encode_zval()
634 return php_json_encode_serializable_object(buf, val, options, encoder); in php_json_encode_zval()
636 if (Z_OBJCE_P(val)->ce_flags & ZEND_ACC_ENUM) { in php_json_encode_zval()
637 return php_json_encode_serializable_enum(buf, val, options, encoder); in php_json_encode_zval()
646 ZVAL_COPY(&zv, val); in php_json_encode_zval()
653 val = Z_REFVAL_P(val); in php_json_encode_zval()