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