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()
113 static zend_result php_json_encode_array(smart_str *buf, zval *val, int options, php_json_encoder *… in php_json_encode_array() argument
118 if (Z_TYPE_P(val) == IS_ARRAY) { in php_json_encode_array()
119 myht = Z_ARRVAL_P(val); in php_json_encode_array()
121 … = (options & PHP_JSON_FORCE_OBJECT) ? PHP_JSON_OUTPUT_OBJECT : php_json_determine_array_type(val); in php_json_encode_array()
122 } else if (Z_OBJ_P(val)->properties == NULL in php_json_encode_array()
123 && Z_OBJ_HT_P(val)->get_properties_for == NULL in php_json_encode_array()
124 && Z_OBJ_HT_P(val)->get_properties == zend_std_get_properties) { in php_json_encode_array()
126 zend_object *obj = Z_OBJ_P(val); in php_json_encode_array()
201 prop_ht = myht = zend_get_properties_for(val, ZEND_PROP_PURPOSE_JSON); in php_json_encode_array()
241 if (ZSTR_VAL(key)[0] == '\0' && ZSTR_LEN(key) > 0 && Z_TYPE_P(val) == IS_OBJECT) { in php_json_encode_array()
531 static zend_result php_json_encode_serializable_object(smart_str *buf, zval *val, int options, php_… in php_json_encode_serializable_object() argument
533 zend_class_entry *ce = Z_OBJCE_P(val); in php_json_encode_serializable_object()
534 HashTable* myht = Z_OBJPROP_P(val); in php_json_encode_serializable_object()
550 …if (FAILURE == call_user_function(NULL, val, &fname, &retval, 0, NULL) || Z_TYPE(retval) == IS_UND… in php_json_encode_serializable_object()
576 (Z_OBJ(retval) == Z_OBJ_P(val))) { in php_json_encode_serializable_object()
593 static zend_result php_json_encode_serializable_enum(smart_str *buf, zval *val, int options, php_js… in php_json_encode_serializable_enum() argument
595 zend_class_entry *ce = Z_OBJCE_P(val); in php_json_encode_serializable_enum()
602 zval *value_zv = zend_enum_fetch_case_value(Z_OBJ_P(val)); in php_json_encode_serializable_enum()
606 zend_result php_json_encode_zval(smart_str *buf, zval *val, int options, php_json_encoder *encoder)… in php_json_encode_zval() argument
609 switch (Z_TYPE_P(val)) in php_json_encode_zval()
623 smart_str_append_long(buf, Z_LVAL_P(val)); in php_json_encode_zval()
627 if (php_json_is_valid_double(Z_DVAL_P(val))) { in php_json_encode_zval()
628 php_json_encode_double(buf, Z_DVAL_P(val), options); in php_json_encode_zval()
636 return php_json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val), options, encoder); in php_json_encode_zval()
639 if (instanceof_function(Z_OBJCE_P(val), php_json_serializable_ce)) { in php_json_encode_zval()
640 return php_json_encode_serializable_object(buf, val, options, encoder); in php_json_encode_zval()
642 if (Z_OBJCE_P(val)->ce_flags & ZEND_ACC_ENUM) { in php_json_encode_zval()
643 return php_json_encode_serializable_enum(buf, val, options, encoder); in php_json_encode_zval()
652 ZVAL_COPY(&zv, val); in php_json_encode_zval()
659 val = Z_REFVAL_P(val); in php_json_encode_zval()