/php-src/Zend/ |
H A D | zend_smart_string.h | 35 #define smart_string_sets(str, src) \ argument 55 if (UNEXPECTED(!str->c) || UNEXPECTED(len >= str->a - str->len)) { in smart_string_alloc() 59 _smart_string_alloc(str, len); in smart_string_alloc() 62 return str->len + len; in smart_string_alloc() 66 if (str->c) { in smart_string_free_ex() 67 pefree(str->c, persistent); in smart_string_free_ex() 68 str->c = NULL; in smart_string_free_ex() 70 str->a = str->len = 0; in smart_string_free_ex() 74 if (str->c) { in smart_string_0() 75 str->c[str->len] = '\0'; in smart_string_0() [all …]
|
H A D | zend_smart_str.c | 36 str->s = zend_string_alloc(str->a, 0); in smart_str_erealloc() 40 …str->s = (zend_string *) erealloc2(str->s, str->a + _ZSTR_HEADER_SIZE + 1, _ZSTR_HEADER_SIZE + ZST… in smart_str_erealloc() 50 str->s = zend_string_alloc(str->a, 1); in smart_str_realloc() 54 str->s = (zend_string *) perealloc(str->s, str->a + _ZSTR_HEADER_SIZE + 1, 1); in smart_str_realloc() 82 res = &ZSTR_VAL(str->s)[ZSTR_LEN(str->s)]; in smart_str_append_escaped() 141 if (!str->c) { in _smart_string_alloc_persistent() 148 str->c = pemalloc(str->a + 1, 1); in _smart_string_alloc_persistent() 155 str->c = perealloc(str->c, str->a + 1, 1); in _smart_string_alloc_persistent() 169 str->c = emalloc_large(str->a + 1); in _smart_string_alloc() 172 str->c = emalloc(str->a + 1); in _smart_string_alloc() [all …]
|
H A D | zend_string.c | 57 return ZSTR_H(str) = zend_hash_func(ZSTR_VAL(str), ZSTR_LEN(str)); in zend_string_hash_func() 68 pefree(str, GC_FLAGS(str) & IS_STR_PERSISTENT); in _str_dtor() 72 #define _ZEND_STR_DSC(id, str) str, argument 90 zend_string *str; in zend_interned_strings_init() local 189 return str; in zend_add_interned_string() 203 str = zend_string_init(ZSTR_VAL(str), ZSTR_LEN(str), persistent); in zend_init_string_for_interning() 206 return str; in zend_init_string_for_interning() 214 return str; in zend_new_interned_string_permanent() 226 str = zend_init_string_for_interning(str, true); in zend_new_interned_string_permanent() 237 return str; in zend_new_interned_string_request() [all …]
|
H A D | zend_ast.c | 81 ZVAL_STR(&zv, str); in zend_ast_create_zval_from_str() 1277 smart_str_appendc(str, c); in zend_ast_export_str() 2626 smart_str_appends(str, op); in zend_ast_export_ex() 2633 smart_str_appends(str, op); in zend_ast_export_ex() 2641 smart_str_appends(str, op); in zend_ast_export_ex() 2646 smart_str_appends(str, op); in zend_ast_export_ex() 2653 smart_str_appends(str, op); in zend_ast_export_ex() 2662 smart_str_appends(str, op); in zend_ast_export_ex() 2676 smart_str str = {0}; in zend_ast_export() local 2681 smart_str_0(&str); in zend_ast_export() [all …]
|
H A D | zend_smart_str.h | 70 if (str->s) { in smart_str_free_ex() 72 str->s = NULL; in smart_str_free_ex() 74 str->a = 0; in smart_str_free_ex() 83 if (str->s) { in smart_str_0() 84 ZSTR_VAL(str->s)[ZSTR_LEN(str->s)] = '\0'; in smart_str_0() local 89 return str->s ? ZSTR_LEN(str->s) : 0; in smart_str_get_len() 94 if (str->s && str->a > ZSTR_LEN(str->s)) { in smart_str_trim_to_size_ex() 95 str->s = zend_string_realloc(str->s, ZSTR_LEN(str->s), persistent); in smart_str_trim_to_size_ex() 96 str->a = ZSTR_LEN(str->s); in smart_str_trim_to_size_ex() 106 if (str->s) { in smart_str_extract_ex() [all …]
|
H A D | zend_string.h | 80 #define STR_ALLOCA_FREE(str, use_heap) ZSTR_ALLOCA_FREE(str, use_heap) in END_EXTERN_C() argument 123 ZSTR_H(str) = 0; \ 133 #define ZSTR_ALLOCA_FREE(str, use_heap) free_alloca(str, use_heap) argument 398 …(ZSTR_LEN(str) == sizeof("" c) - 1 && !zend_binary_strcasecmp(ZSTR_VAL(str), ZSTR_LEN(str), (c), s… 492 str[2] * Z_L(33) + in zend_inline_hash_func() 493 str[3]; in zend_inline_hash_func() 499 str[7]; in zend_inline_hash_func() 508 str[3]; in zend_inline_hash_func() 510 str += 4; in zend_inline_hash_func() 518 str[2]; in zend_inline_hash_func() [all …]
|
/php-src/Zend/tests/ |
H A D | str_offset_004.phpt | 11 $str[2] = 'C'; 12 var_dump($str); 14 $str[$i] = 'Z'; 15 var_dump($str); 17 $str[-5] = 'P'; 18 var_dump($str); 20 $str[$j] = 'Q'; 21 var_dump($str); 24 var_dump($str); 26 $str[-strlen($str)] = strtoupper($str[0]); /* An exotic ucfirst() ;) */ [all …]
|
H A D | bug53432.phpt | 6 $str = ''; 8 var_dump($str); 10 $str = ''; 12 var_dump($str); 14 $str = ''; 16 var_dump($str); 18 $str = ''; 24 var_dump($str); 26 $str = ''; 34 $str = ''; [all …]
|
H A D | isset_str_offset.phpt | 8 $str = "test0123"; 10 var_dump(isset($str[-1])); 11 var_dump(isset($str[-10])); 12 var_dump(isset($str[0])); 13 var_dump(isset($str[1])); 14 var_dump(isset($str[4])); // 0 15 var_dump(isset($str[5])); // 1 16 var_dump(isset($str[8])); 17 var_dump(isset($str[10000])); 22 var_dump(isset($str['0'])); [all …]
|
H A D | empty_str_offset.phpt | 8 $str = "test0123"; 10 var_dump(empty($str[-1])); 11 var_dump(empty($str[-10])); 12 var_dump(empty($str[-4])); // 0 13 var_dump(empty($str[0])); 14 var_dump(empty($str[1])); 15 var_dump(empty($str[4])); // 0 17 var_dump(empty($str[8])); 18 var_dump(empty($str[10000])); 23 var_dump(empty($str['0'])); [all …]
|
H A D | str_offset_001.phpt | 11 $str = "abc"; 12 var_dump($str[0]); 13 var_dump($str[1]); 14 var_dump($str[2]); 15 var_dump($str[3]); 19 foo($str[0]); 20 foo($str[1]); 21 foo($str[2]); 22 foo($str[3]); 23 foo($str[1][0]); [all …]
|
H A D | bug48770_2.phpt | 7 public function func($str) { 8 var_dump(__METHOD__ .': '. $str); 10 private function func2($str) { 11 var_dump(__METHOD__ .': '. $str); 13 protected function func3($str) { 16 private function func22($str) { 22 public function func($str) { 38 private function func2($str) { 41 protected function func3($str) { 47 public function func($str) { [all …]
|
/php-src/ext/filter/ |
H A D | logical_filters.c | 115 if (str < end && *str >= '1' && *str <= '9') { in php_filter_parse_int() 128 if (*str >= '0' && *str <= '9') { in php_filter_parse_int() 152 if (*str >= '0' && *str <= '7') { in php_filter_parse_octal() 176 if (*str >= '0' && *str <= '9') { in php_filter_parse_hex() 398 if (str < end && (*str == '+' || *str == '-')) { in php_filter_float() 404 while (str < end && *str >= '0' && *str <= '9') { in php_filter_float() 408 if (str == end || *str == dec_sep || *str == 'e' || *str == 'E') { in php_filter_float() 415 while (str < end && *str >= '0' && *str <= '9') { in php_filter_float() 421 if (str < end && (*str == '+' || *str == '-')) { in php_filter_float() 424 while (str < end && *str >= '0' && *str <= '9') { in php_filter_float() [all …]
|
/php-src/ext/dom/lexbor/lexbor/core/ |
H A D | str.c | 83 str->data = lexbor_mraw_free(mraw, str->data); in lexbor_str_destroy() 136 lexbor_str_check_size_arg_m(str, lexbor_str_size(str), in lexbor_str_append() 139 data_begin = &str->data[str->length]; in lexbor_str_append() 143 str->data[str->length] = '\0'; in lexbor_str_append() 157 data_begin = &str->data[str->length]; in lexbor_str_append_before() 159 memmove(&str->data[length], str->data, sizeof(lxb_char_t) * str->length); in lexbor_str_append_before() 163 str->data[str->length] = '\0'; in lexbor_str_append_before() 174 str->data[str->length] = data; in lexbor_str_append_one() 177 str->data[str->length] = '\0'; in lexbor_str_append_one() 179 return &str->data[(str->length - 1)]; in lexbor_str_append_one() [all …]
|
H A D | str.h | 19 #define lexbor_str_get(str, attr) str->attr argument 20 #define lexbor_str_set(str, attr) lexbor_str_get(str, attr) argument 21 #define lexbor_str_len(str) lexbor_str_get(str, length) argument 64 lexbor_str_clean(lexbor_str_t *str); 187 lexbor_str_data(lexbor_str_t *str) in lexbor_str_data() argument 189 return str->data; in lexbor_str_data() 195 return str->length; in lexbor_str_length() 207 str->data = data; in lexbor_str_data_set() 222 str->length = length; in lexbor_str_length_set() 223 str->data[length] = 0x00; in lexbor_str_length_set() [all …]
|
/php-src/ext/mbstring/tests/ |
H A D | mb_preferred_mime_name.phpt | 10 echo "$str\n"; 12 $str = mb_preferred_mime_name('SJIS'); 13 echo "$str\n"; 16 echo "$str\n"; 19 echo "$str\n"; 22 echo "$str\n"; 24 $str = mb_preferred_mime_name('JIS'); 25 echo "$str\n"; 28 echo "$str\n"; 31 echo "$str\n"; [all …]
|
H A D | casemapping.phpt | 8 function toCases($str) { 9 echo "String: $str\n"; 10 echo "Lower: ", mb_convert_case($str, MB_CASE_LOWER), "\n"; 31 $str = "\xdd"; 32 echo bin2hex(mb_convert_case($str, MB_CASE_LOWER)), "\n"; 34 echo bin2hex(mb_convert_case($str, MB_CASE_FOLD)), "\n"; 39 $str = "\xfd"; 42 echo bin2hex(mb_convert_case($str, MB_CASE_FOLD)), "\n"; 47 $str = "\x49"; 50 echo bin2hex(mb_convert_case($str, MB_CASE_FOLD)), "\n"; [all …]
|
H A D | mb_check_encoding.phpt | 9 $str = "Japanese UTF-8 text. 日本語のUTF-8テキスト"; 10 $arr = [1234, 12.34, TRUE, FALSE, NULL, $str, 'key'=>$str, $str=>'val']; 11 var_dump(mb_check_encoding($str), mb_check_encoding($arr)); 14 $str = "Japanese UTF-8 text. 日本語\xFE\x01\x02のUTF-8テキスト"; 15 $arr1 = [1234, 12.34, TRUE, FALSE, NULL, 'key'=>$str, $str=>'val']; 16 $arr2 = [1234, 12.34, TRUE, FALSE, NULL, $str=>'val']; 17 var_dump(mb_check_encoding($str), mb_check_encoding($arr1), mb_check_encoding($arr2));
|
/php-src/ext/sodium/tests/ |
H A D | inc_add.phpt | 15 $str = "abc"; 16 $str2 = $str; 17 sodium_increment($str); 18 var_dump($str, $str2); 21 $str2 = $str; 22 sodium_increment($str); 23 var_dump($str, $str2); 34 $str = "abc"; 35 $str2 = $str; 37 var_dump($str, $str2); [all …]
|
/php-src/ext/dom/lexbor/lexbor/css/ |
H A D | css.c | 11 lexbor_str_t *str; member 164 tmp = &parser->str; in lxb_css_make_data() 180 memcpy(str->data + str->length, tmp->data + offlen, length); in lxb_css_make_data() 184 memcpy(str->data + str->length, tmp->data + offlen, len); in lxb_css_make_data() 196 memcpy(str->data + str->length, pos, length); in lxb_css_make_data() 201 str->data[str->length] = '\0'; in lxb_css_make_data() 212 lexbor_str_t str; in lxb_css_serialize_char_handler() local 225 str.length = 0; in lxb_css_serialize_char_handler() 233 str.data[str.length] = '\0'; in lxb_css_serialize_char_handler() 239 return str.data; in lxb_css_serialize_char_handler() [all …]
|
/php-src/ext/standard/tests/strings/ |
H A D | strspn_variation9.phpt | 46 foreach($strings as $str) { 47 echo "\n-- Iteration with str value \"$str\" --\n"; 50 var_dump( strspn($str,$mask) ); 58 -- Iteration with str value "" -- 61 -- Iteration with str value "" -- 64 -- Iteration with str value " 68 -- Iteration with str value "\n" -- 71 -- Iteration with str value "hello world 86 -- Iteration with str value "hello%0world 93 -- Iteration with str value "%0%0" -- [all …]
|
H A D | strcspn_variation9.phpt | 46 foreach($strings as $str) { 47 echo "\n-- Iteration with str value \"$str\" --\n"; 50 var_dump( strcspn($str,$mask) ); 58 -- Iteration with str value "" -- 61 -- Iteration with str value "" -- 64 -- Iteration with str value " 68 -- Iteration with str value "\n" -- 71 -- Iteration with str value "hello world 86 -- Iteration with str value "hello%0world 93 -- Iteration with str value "%0%0" -- [all …]
|
/php-src/ext/dom/tests/modern/html/encoding/ |
H A D | HTMLDocument_encoding_edge_case_08.phpt | 8 function test(string $str) { 9 $dom = Dom\HTMLDocument::createFromString($str); 18 $str = str_repeat('A', 4095) . "\xf0\x90" . str_repeat('B', 100); 19 test($str); 22 test($str); 25 test($str); 28 test($str); 30 $str = str_repeat('A', 4094) . "\xf0\x90"; 31 test($str); 33 $str = str_repeat('A', 4095) . "\xf0\x90"; [all …]
|
/php-src/ext/standard/ |
H A D | base64.h | 70 static inline zend_string *php_base64_encode(const unsigned char *str, size_t len) { in php_base64_encode() argument 71 return php_base64_encode_ex(str, len, 0); in php_base64_encode() 73 static inline zend_string *php_base64_encode_str(const zend_string *str) { in php_base64_encode_str() argument 74 return php_base64_encode((const unsigned char*)(ZSTR_VAL(str)), ZSTR_LEN(str)); in php_base64_encode_str() 77 static inline zend_string *php_base64_decode(const unsigned char *str, size_t len) { in php_base64_decode() argument 78 return php_base64_decode_ex(str, len, 0); in php_base64_decode() 80 static inline zend_string *php_base64_decode_str(const zend_string *str) { in php_base64_decode_str() argument 81 return php_base64_decode_ex((const unsigned char*)(ZSTR_VAL(str)), ZSTR_LEN(str), 0); in php_base64_decode_str()
|
/php-src/ext/odbc/ |
H A D | odbc_utils.c | 30 zend_string *str; in PHP_FUNCTION() local 33 Z_PARAM_STR(str) in PHP_FUNCTION() 36 bool is_quoted = php_odbc_connstr_is_quoted(ZSTR_VAL(str)); in PHP_FUNCTION() 43 zend_string *str; in PHP_FUNCTION() local 46 Z_PARAM_STR(str) in PHP_FUNCTION() 49 bool should_quote = php_odbc_connstr_should_quote(ZSTR_VAL(str)); in PHP_FUNCTION() 56 zend_string *str; in PHP_FUNCTION() local 59 Z_PARAM_STR(str) in PHP_FUNCTION() 62 size_t new_size = php_odbc_connstr_estimate_quote_length(ZSTR_VAL(str)); in PHP_FUNCTION() 64 php_odbc_connstr_quote(ZSTR_VAL(new_string), ZSTR_VAL(str), new_size); in PHP_FUNCTION()
|