xref: /PHP-8.0/ext/intl/php_intl.stub.php (revision d5aed7b0)
1<?php
2
3/** @generate-function-entries */
4
5class IntlException extends Exception
6{
7}
8
9/* calendar */
10
11/** @param IntlTimeZone|DateTimeZone|string|null $timezone */
12function intlcal_create_instance($timezone = null, ?string $locale = null): ?IntlCalendar {}
13
14function intlcal_get_keyword_values_for_locale(string $keyword, string $locale, bool $onlyCommon): IntlIterator|false {}
15
16function intlcal_get_now(): float {}
17
18function intlcal_get_available_locales(): array {}
19
20function intlcal_get(IntlCalendar $calendar, int $field): int|false {}
21
22function intlcal_get_time(IntlCalendar $calendar): float|false {}
23
24function intlcal_set_time(IntlCalendar $calendar, float $timestamp): bool {}
25
26function intlcal_add(IntlCalendar $calendar, int $field, int $value): bool {}
27
28/** @param IntlTimeZone|DateTimeZone|string|null $timezone */
29function intlcal_set_time_zone(IntlCalendar $calendar, $timezone): bool {}
30
31function intlcal_after(IntlCalendar $calendar, IntlCalendar $other): bool {}
32
33function intlcal_before(IntlCalendar $calendar, IntlCalendar $other): bool {}
34
35function intlcal_set(IntlCalendar $calendar, int $year, int $month, int $dayOfMonth = UNKNOWN, int $hour = UNKNOWN, int $minute = UNKNOWN, int $second = UNKNOWN): bool {}
36
37/** @param int|bool $value */
38function intlcal_roll(IntlCalendar $calendar, int $field, $value): bool {}
39
40function intlcal_clear(IntlCalendar $calendar, ?int $field = null): bool {}
41
42function intlcal_field_difference(IntlCalendar $calendar, float $timestamp, int $field): int|false {}
43
44function intlcal_get_actual_maximum(IntlCalendar $calendar, int $field): int|false {}
45
46function intlcal_get_actual_minimum(IntlCalendar $calendar, int $field): int|false {}
47
48function intlcal_get_day_of_week_type(IntlCalendar $calendar, int $dayOfWeek): int|false {}
49
50function intlcal_get_first_day_of_week(IntlCalendar $calendar): int|false {}
51
52function intlcal_get_least_maximum(IntlCalendar $calendar, int $field): int|false {}
53
54function intlcal_get_greatest_minimum(IntlCalendar $calendar, int $field): int|false {}
55
56function intlcal_get_locale(IntlCalendar $calendar, int $type): string|false {}
57
58function intlcal_get_maximum(IntlCalendar $calendar, int $field): int|false {}
59
60function intlcal_get_minimal_days_in_first_week(IntlCalendar $calendar): int|false {}
61
62function intlcal_set_minimal_days_in_first_week(IntlCalendar $calendar, int $days): bool {}
63
64function intlcal_get_minimum(IntlCalendar $calendar, int $field): int|false {}
65
66function intlcal_get_time_zone(IntlCalendar $calendar): IntlTimeZone|false {}
67
68function intlcal_get_type(IntlCalendar $calendar): string {}
69
70function intlcal_get_weekend_transition(IntlCalendar $calendar, int $dayOfWeek): int|false {}
71
72function intlcal_in_daylight_time(IntlCalendar $calendar): bool {}
73
74function intlcal_is_lenient(IntlCalendar $calendar): bool {}
75
76function intlcal_is_set(IntlCalendar $calendar, int $field): bool {}
77
78function intlcal_is_equivalent_to(IntlCalendar $calendar, IntlCalendar $other): bool {}
79
80function intlcal_is_weekend(IntlCalendar $calendar, ?float $timestamp = null): bool {}
81
82function intlcal_set_first_day_of_week(IntlCalendar $calendar, int $dayOfWeek): bool {}
83
84function intlcal_set_lenient(IntlCalendar $calendar, bool $lenient): bool {}
85
86function intlcal_get_repeated_wall_time_option(IntlCalendar $calendar): int {}
87
88function intlcal_equals(IntlCalendar $calendar, IntlCalendar $other): bool {}
89
90function intlcal_get_skipped_wall_time_option(IntlCalendar $calendar): int {}
91
92function intlcal_set_repeated_wall_time_option(IntlCalendar $calendar, int $option): bool {}
93
94function intlcal_set_skipped_wall_time_option(IntlCalendar $calendar, int $option): bool {}
95
96function intlcal_from_date_time(DateTime|string $datetime, ?string $locale = null): ?IntlCalendar {}
97
98function intlcal_to_date_time(IntlCalendar $calendar): DateTime|false {}
99
100function intlcal_get_error_code(IntlCalendar $calendar): int|false {}
101
102function intlcal_get_error_message(IntlCalendar $calendar): string|false {}
103
104/**
105 * @param DateTimeZone|IntlTimeZone|string|int|null $timezoneOrYear
106 * @param string|int|null $localeOrMonth
107 * @param int $day
108 * @param int $hour
109 * @param int $minute
110 * @param int $second
111 */
112function intlgregcal_create_instance($timezoneOrYear = UNKNOWN, $localeOrMonth = UNKNOWN, $day = UNKNOWN, $hour = UNKNOWN, $minute = UNKNOWN, $second = UNKNOWN): ?IntlGregorianCalendar {}
113
114function intlgregcal_set_gregorian_change(IntlGregorianCalendar $calendar, float $timestamp): bool {}
115
116function intlgregcal_get_gregorian_change(IntlGregorianCalendar $calendar): float {}
117
118function intlgregcal_is_leap_year(IntlGregorianCalendar $calendar, int $year): bool {}
119
120/* collator */
121
122function collator_create(string $locale): ?Collator {}
123
124function collator_compare(Collator $object, string $string1, string $string2): int|false {}
125
126function collator_get_attribute(Collator $object, int $attribute): int|false {}
127
128function collator_set_attribute(Collator $object, int $attribute, int $value): bool {}
129
130function collator_get_strength(Collator $object): int {}
131
132function collator_set_strength(Collator $object, int $strength): bool {}
133
134function collator_sort(Collator $object, array &$array, int $flags = Collator::SORT_REGULAR): bool {}
135
136function collator_sort_with_sort_keys(Collator $object, array &$array): bool {}
137
138function collator_asort(Collator $object, array &$array, int $flags = Collator::SORT_REGULAR): bool {}
139
140function collator_get_locale(Collator $object, int $type): string|false {}
141
142function collator_get_error_code(Collator $object): int|false {}
143
144function collator_get_error_message(Collator $object): string|false {}
145
146function collator_get_sort_key(Collator $object, string $string): string|false {}
147
148/* common */
149
150function intl_get_error_code(): int {}
151
152function intl_get_error_message(): string {}
153
154function intl_is_failure(int $errorCode): bool {}
155
156function intl_error_name(int $errorCode): string {}
157
158/* dateformat */
159
160/** @param IntlTimeZone|DateTimeZone|string|null $timezone */
161function datefmt_create(?string $locale, int $dateType, int $timeType, $timezone = null, IntlCalendar|int|null $calendar = null, ?string $pattern = null): ?IntlDateFormatter {}
162
163function datefmt_get_datetype(IntlDateFormatter $formatter): int|false {}
164
165function datefmt_get_timetype(IntlDateFormatter $formatter): int|false {}
166
167function datefmt_get_calendar(IntlDateFormatter $formatter): int|false {}
168
169function datefmt_set_calendar(IntlDateFormatter $formatter, IntlCalendar|int|null $calendar): bool {}
170
171function datefmt_get_timezone_id(IntlDateFormatter $formatter): string|false {}
172
173function datefmt_get_calendar_object(IntlDateFormatter $formatter): IntlCalendar|false|null {}
174
175function datefmt_get_timezone(IntlDateFormatter $formatter): IntlTimeZone|false {}
176
177/** @param IntlTimeZone|DateTimeZone|string|null $timezone */
178function datefmt_set_timezone(IntlDateFormatter $formatter, $timezone): ?bool {}
179
180function datefmt_set_pattern(IntlDateFormatter $formatter, string $pattern): bool {}
181
182function datefmt_get_pattern(IntlDateFormatter $formatter): string|false {}
183
184function datefmt_get_locale(IntlDateFormatter $formatter, int $type = ULOC_ACTUAL_LOCALE): string|false {}
185
186function datefmt_set_lenient(IntlDateFormatter $formatter, bool $lenient): void {}
187
188function datefmt_is_lenient(IntlDateFormatter $formatter): bool {}
189
190/** @param IntlCalendar|DateTimeInterface|array|string|int|float $datetime */
191function datefmt_format(IntlDateFormatter $formatter, $datetime): string|false {}
192
193/**
194 * @param IntlCalendar|DateTimeInterface $datetime
195 * @param array|int|string|null $format
196 */
197function datefmt_format_object($datetime, $format = null, ?string $locale = null): string|false {}
198
199/** @param int $offset */
200function datefmt_parse(IntlDateFormatter $formatter, string $string, &$offset = null): int|float|false {}
201
202/** @param int $offset */
203function datefmt_localtime(IntlDateFormatter $formatter, string $string, &$offset = null): array|false {}
204
205function datefmt_get_error_code(IntlDateFormatter $formatter): int {}
206
207function datefmt_get_error_message(IntlDateFormatter $formatter): string {}
208
209/* formatter */
210
211function numfmt_create(string $locale, int $style, ?string $pattern = null): ?NumberFormatter {}
212
213function numfmt_format(NumberFormatter $formatter, int|float $num, int $type = NumberFormatter::TYPE_DEFAULT): string|false {}
214
215/** @param int $offset */
216function numfmt_parse(NumberFormatter $formatter, string $string, int $type = NumberFormatter::TYPE_DOUBLE, &$offset = null): int|float|false {}
217
218function numfmt_format_currency(NumberFormatter $formatter, float $amount, string $currency): string|false {}
219
220/**
221 * @param string $currency
222 * @param int $offset
223 */
224function numfmt_parse_currency(NumberFormatter $formatter, string $string, &$currency, &$offset = null): float|false {}
225
226function numfmt_set_attribute(NumberFormatter $formatter, int $attribute, int|float $value): bool {}
227
228function numfmt_get_attribute(NumberFormatter $formatter, int $attribute): int|float|false {}
229
230function numfmt_set_text_attribute(NumberFormatter $formatter, int $attribute, string $value): bool {}
231
232function numfmt_get_text_attribute(NumberFormatter $formatter, int $attribute): string|false {}
233
234function numfmt_set_symbol(NumberFormatter $formatter, int $symbol, string $value): bool {}
235
236function numfmt_get_symbol(NumberFormatter $formatter, int $symbol): string|false {}
237
238function numfmt_set_pattern(NumberFormatter $formatter, string $pattern): bool {}
239
240function numfmt_get_pattern(NumberFormatter $formatter): string|false {}
241
242function numfmt_get_locale(NumberFormatter $formatter, int $type = ULOC_ACTUAL_LOCALE): string|false {}
243
244function numfmt_get_error_code(NumberFormatter $formatter): int {}
245
246function numfmt_get_error_message(NumberFormatter $formatter): string {}
247
248/* grapheme */
249
250function grapheme_strlen(string $string): int|false|null {}
251
252function grapheme_strpos(string $haystack, string $needle, int $offset = 0): int|false {}
253
254function grapheme_stripos(string $haystack, string $needle, int $offset = 0): int|false {}
255
256function grapheme_strrpos(string $haystack, string $needle, int $offset = 0): int|false {}
257
258function grapheme_strripos(string $haystack, string $needle, int $offset = 0): int|false {}
259
260function grapheme_substr(string $string, int $offset, ?int $length = null): string|false {}
261
262function grapheme_strstr(string $haystack, string $needle, bool $beforeNeedle = false): string|false {}
263
264function grapheme_stristr(string $haystack, string $needle, bool $beforeNeedle = false): string|false {}
265
266/** @param int $next */
267function grapheme_extract(string $haystack, int $size, int $type = GRAPHEME_EXTR_COUNT, int $offset = 0, &$next = null): string|false {}
268
269/* idn */
270
271/** @param array $idna_info */
272function idn_to_ascii(string $domain, int $flags = IDNA_DEFAULT, int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false {}
273
274/** @param array $idna_info */
275function idn_to_utf8(string $domain, int $flags = IDNA_DEFAULT, int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false {}
276
277/* locale */
278
279
280function locale_get_default(): string {}
281
282function locale_set_default(string $locale): bool {}
283
284function locale_get_primary_language(string $locale): ?string {}
285
286function locale_get_script(string $locale): ?string {}
287
288function locale_get_region(string $locale): ?string {}
289
290function locale_get_keywords(string $locale): array|false|null {}
291
292function locale_get_display_script(string $locale, ?string $displayLocale = null): string|false {}
293
294function locale_get_display_region(string $locale, ?string $displayLocale = null): string|false {}
295
296function locale_get_display_name(string $locale, ?string $displayLocale = null): string|false {}
297
298function locale_get_display_language(string $locale, ?string $displayLocale = null): string|false {}
299
300function locale_get_display_variant(string $locale, ?string $displayLocale = null): string|false {}
301
302function locale_compose(array $subtags): string|false {}
303
304function locale_parse(string $locale): ?array {}
305
306function locale_get_all_variants(string $locale): ?array {}
307
308function locale_filter_matches(string $languageTag, string $locale, bool $canonicalize = false): ?bool {}
309
310function locale_canonicalize(string $locale): ?string {}
311
312function locale_lookup(array $languageTag, string $locale, bool $canonicalize = false, ?string $defaultLocale = null): ?string {}
313
314function locale_accept_from_http(string $header): string|false {}
315
316/* msgformat */
317
318function msgfmt_create(string $locale, string $pattern): ?MessageFormatter {}
319
320function msgfmt_format(MessageFormatter $formatter, array $values): string|false {}
321
322function msgfmt_format_message(string $locale, string $pattern, array $values): string|false {}
323
324function msgfmt_parse(MessageFormatter $formatter, string $string): array|false {}
325
326function msgfmt_parse_message(string $locale, string $pattern, string $message): array|false {}
327
328function msgfmt_set_pattern(MessageFormatter $formatter, string $pattern): bool {}
329
330function msgfmt_get_pattern(MessageFormatter $formatter): string|false {}
331
332function msgfmt_get_locale(MessageFormatter $formatter): string {}
333
334function msgfmt_get_error_code(MessageFormatter $formatter): int {}
335
336function msgfmt_get_error_message(MessageFormatter $formatter): string {}
337
338/* normalizer */
339
340function normalizer_normalize(string $string, int $form = Normalizer::FORM_C): string|false {}
341
342function normalizer_is_normalized(string $string, int $form = Normalizer::FORM_C): bool {}
343
344#if U_ICU_VERSION_MAJOR_NUM >= 56
345function normalizer_get_raw_decomposition(string $string, int $form = Normalizer::FORM_C): ?string {}
346#endif
347
348/* resourceboundle */
349
350function resourcebundle_create(?string $locale, ?string $bundle, bool $fallback = true): ?ResourceBundle {}
351
352/** @param string|int $index */
353function resourcebundle_get(ResourceBundle $bundle, $index, bool $fallback = true): mixed {}
354
355function resourcebundle_count(ResourceBundle $bundle): int {}
356
357function resourcebundle_locales(string $bundle): array|false {}
358
359function resourcebundle_get_error_code(ResourceBundle $bundle): int {}
360
361function resourcebundle_get_error_message(ResourceBundle $bundle): string {}
362
363/* timezone */
364
365function intltz_count_equivalent_ids(string $timezoneId): int|false {}
366
367function intltz_create_default(): IntlTimeZone {}
368
369/** @param IntlTimeZone|string|int|float|null $countryOrRawOffset */
370function intltz_create_enumeration($countryOrRawOffset = null): IntlIterator|false {}
371
372function intltz_create_time_zone(string $timezoneId): ?IntlTimeZone {}
373
374function intltz_create_time_zone_id_enumeration(int $type, ?string $region = null, ?int $rawOffset = null): IntlIterator|false {}
375
376function intltz_from_date_time_zone(DateTimeZone $timezone): ?IntlTimeZone {}
377
378/** @param bool $isSystemId */
379function intltz_get_canonical_id(string $timezoneId, &$isSystemId = null): string|false {}
380
381function intltz_get_display_name(IntlTimeZone $timezone, bool $dst = false, int $style = IntlTimeZone::DISPLAY_LONG, ?string $locale = null): string|false {}
382
383function intltz_get_dst_savings(IntlTimeZone $timezone): int {}
384
385function intltz_get_equivalent_id(string $timezoneId, int $offset): string|false {}
386
387function intltz_get_error_code(IntlTimeZone $timezone): int|false {}
388
389function intltz_get_error_message(IntlTimeZone $timezone): string|false {}
390
391function intltz_get_gmt(): IntlTimeZone {}
392
393function intltz_get_id(IntlTimeZone $timezone): string|false {}
394
395/**
396 * @param int $rawOffset
397 * @param int $dstOffset
398 */
399function intltz_get_offset(IntlTimeZone $timezone, float $timestamp, bool $local, &$rawOffset, &$dstOffset): bool {}
400
401function intltz_get_raw_offset(IntlTimeZone $timezone): int {}
402
403function intltz_get_region(string $timezoneId): string|false {}
404
405function intltz_get_tz_data_version(): string|false {}
406
407function intltz_get_unknown(): IntlTimeZone {}
408
409#if U_ICU_VERSION_MAJOR_NUM >= 52
410function intltz_get_windows_id(string $timezoneId): string|false {}
411
412function intltz_get_id_for_windows_id(string $timezoneId, ?string $region = null): string|false {}
413#endif
414
415function intltz_has_same_rules(IntlTimeZone $timezone, IntlTimeZone $other): bool {}
416
417function intltz_to_date_time_zone(IntlTimeZone $timezone): DateTimeZone|false {}
418
419function intltz_use_daylight_time(IntlTimeZone $timezone): bool {}
420
421/* transliterator */
422
423function transliterator_create(string $id, int $direction = Transliterator::FORWARD): ?Transliterator {}
424
425function transliterator_create_from_rules(string $rules, int $direction = Transliterator::FORWARD): ?Transliterator {}
426
427function transliterator_list_ids(): array|false {}
428
429function transliterator_create_inverse(Transliterator $transliterator): ?Transliterator {}
430
431function transliterator_transliterate(Transliterator|string $transliterator, string $string, int $start = 0, int $end = -1): string|false {}
432
433function transliterator_get_error_code(Transliterator $transliterator): int|false {}
434
435function transliterator_get_error_message(Transliterator $transliterator): string|false {}
436