1<?php 2 3/** @generate-class-entries */ 4 5/** 6 * @var string 7 * @cvalue DATE_FORMAT_RFC3339 8 */ 9const DATE_ATOM = "Y-m-d\\TH:i:sP"; 10 11/** 12 * @var string 13 * @cvalue DATE_FORMAT_COOKIE 14 */ 15const DATE_COOKIE = "l, d-M-Y H:i:s T"; 16 17/** 18 * @var string 19 * @cvalue DATE_FORMAT_ISO8601 20 */ 21const DATE_ISO8601 = "Y-m-d\\TH:i:sO"; 22 23/** 24 * @var string 25 * @cvalue DATE_FORMAT_ISO8601_EXPANDED 26 */ 27const DATE_ISO8601_EXPANDED = "X-m-d\\TH:i:sP"; 28 29/** 30 * @var string 31 * @cvalue DATE_FORMAT_RFC822 32 */ 33const DATE_RFC822 = "D, d M y H:i:s O"; 34 35/** 36 * @var string 37 * @cvalue DATE_FORMAT_RFC850 38 */ 39const DATE_RFC850 = "l, d-M-y H:i:s T"; 40 41/** 42 * @var string 43 * @cvalue DATE_FORMAT_RFC1036 44 */ 45const DATE_RFC1036 = "D, d M y H:i:s O"; 46 47/** 48 * @var string 49 * @cvalue DATE_FORMAT_RFC1123 50 */ 51const DATE_RFC1123 = "D, d M Y H:i:s O"; 52 53/** 54 * @var string 55 * @cvalue DATE_FORMAT_RFC7231 56 */ 57const DATE_RFC7231 = "D, d M Y H:i:s \\G\\M\\T"; 58 59/** 60 * @var string 61 * @cvalue DATE_FORMAT_RFC2822 62 */ 63const DATE_RFC2822 = "D, d M Y H:i:s O"; 64 65/** 66 * @var string 67 * @cvalue DATE_FORMAT_RFC3339 68 */ 69const DATE_RFC3339 = "Y-m-d\\TH:i:sP"; 70 71/** 72 * @var string 73 * @cvalue DATE_FORMAT_RFC3339_EXTENDED 74 */ 75const DATE_RFC3339_EXTENDED = "Y-m-d\\TH:i:s.vP"; 76 77/** @var string */ 78const DATE_RSS = DATE_RFC1123; 79 80/** @var string */ 81const DATE_W3C = DATE_RFC3339; 82 83/** 84 * @var int 85 * @cvalue SUNFUNCS_RET_TIMESTAMP 86 */ 87const SUNFUNCS_RET_TIMESTAMP = UNKNOWN; 88 89/** 90 * @var int 91 * @cvalue SUNFUNCS_RET_STRING 92 */ 93const SUNFUNCS_RET_STRING = UNKNOWN; 94 95/** 96 * @var int 97 * @cvalue SUNFUNCS_RET_DOUBLE 98 */ 99const SUNFUNCS_RET_DOUBLE = UNKNOWN; 100 101function strtotime(string $datetime, ?int $baseTimestamp = null): int|false {} 102 103/** @refcount 1 */ 104function date(string $format, ?int $timestamp = null): string {} 105 106function idate(string $format, ?int $timestamp = null): int|false {} 107 108/** @refcount 1 */ 109function gmdate(string $format, ?int $timestamp = null): string {} 110 111function mktime( 112 int $hour, ?int $minute = null, ?int $second = null, 113 ?int $month = null, ?int $day = null, ?int $year = null): int|false {} 114 115function gmmktime( 116 int $hour, ?int $minute = null, ?int $second = null, 117 ?int $month = null, ?int $day = null, ?int $year = null): int|false {} 118 119function checkdate(int $month, int $day, int $year): bool {} 120 121/** 122 * @refcount 1 123 * @deprecated 124 */ 125function strftime(string $format, ?int $timestamp = null): string|false {} 126 127/** 128 * @refcount 1 129 * @deprecated 130 */ 131function gmstrftime(string $format, ?int $timestamp = null): string|false {} 132 133function time(): int {} 134 135/** 136 * @return array<int|string, int> 137 * @refcount 1 138 */ 139function localtime(?int $timestamp = null, bool $associative = false): array {} 140 141/** 142 * @return array<int|string, int|string> 143 * @refcount 1 144 */ 145function getdate(?int $timestamp = null): array {} 146 147/** @refcount 1 */ 148function date_create(string $datetime = "now", ?DateTimeZone $timezone = null): DateTime|false {} 149 150/** @refcount 1 */ 151function date_create_immutable( 152 string $datetime = "now", ?DateTimeZone $timezone = null): DateTimeImmutable|false {} 153 154/** @refcount 1 */ 155function date_create_from_format( 156 string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false {} 157 158/** @refcount 1 */ 159function date_create_immutable_from_format( 160 string $format, string $datetime, ?DateTimeZone $timezone = null): DateTimeImmutable|false {} 161 162/** 163 * @return array<string, mixed> 164 * @refcount 1 165 */ 166function date_parse(string $datetime): array {} 167 168/** 169 * @return array<string, mixed> 170 * @refcount 1 171 */ 172function date_parse_from_format(string $format, string $datetime): array {} 173 174/** 175 * @return array<string, int|array>|false 176 * @refcount 1 177 */ 178function date_get_last_errors(): array|false {} 179 180/** @refcount 1 */ 181function date_format(DateTimeInterface $object, string $format): string {} 182 183function date_modify(DateTime $object, string $modifier): DateTime|false {} 184 185function date_add(DateTime $object, DateInterval $interval): DateTime {} 186 187function date_sub(DateTime $object, DateInterval $interval): DateTime {} 188 189/** @refcount 1 */ 190function date_timezone_get(DateTimeInterface $object): DateTimeZone|false {} 191 192function date_timezone_set(DateTime $object, DateTimeZone $timezone): DateTime {} 193 194function date_offset_get(DateTimeInterface $object): int {} 195 196/** @refcount 1 */ 197function date_diff( 198 DateTimeInterface $baseObject, DateTimeInterface $targetObject, bool $absolute = false): DateInterval {} 199 200function date_time_set( 201 DateTime $object, int $hour, int $minute, int $second = 0, int $microsecond = 0): DateTime {} 202 203function date_date_set(DateTime $object, int $year, int $month, int $day): DateTime {} 204 205function date_isodate_set(DateTime $object, int $year, int $week, int $dayOfWeek = 1): DateTime {} 206 207function date_timestamp_set(DateTime $object, int $timestamp): DateTime {} 208 209function date_timestamp_get(DateTimeInterface $object): int {} 210 211/** @refcount 1 */ 212function timezone_open(string $timezone): DateTimeZone|false {} 213 214/** @refcount 1 */ 215function timezone_name_get(DateTimeZone $object): string {} 216 217/** @refcount 1 */ 218function timezone_name_from_abbr(string $abbr, int $utcOffset = -1, int $isDST = -1): string|false {} 219 220function timezone_offset_get(DateTimeZone $object, DateTimeInterface $datetime): int {} 221 222/** 223 * @return array<int, array>|false 224 * @refcount 1 225 */ 226function timezone_transitions_get( 227 DateTimeZone $object, int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false {} 228 229/** 230 * @return array<string, float|string>|false 231 * @refcount 1 232 */ 233function timezone_location_get(DateTimeZone $object): array|false {} 234 235/** 236 * @return array<int, string> 237 * @refcount 1 238 */ 239function timezone_identifiers_list(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array {} 240 241/** 242 * @return array<string, array> 243 * @refcount 1 244 */ 245function timezone_abbreviations_list(): array {} 246 247/** @refcount 1 */ 248function timezone_version_get(): string {} 249 250/** @refcount 1 */ 251function date_interval_create_from_date_string(string $datetime): DateInterval|false {} 252 253/** @refcount 1 */ 254function date_interval_format(DateInterval $object, string $format): string {} 255 256function date_default_timezone_set(string $timezoneId): bool {} 257 258/** @refcount 1 */ 259function date_default_timezone_get(): string {} 260 261/** 262 * @refcount 1 263 * @deprecated 264 */ 265function date_sunrise( 266 int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, 267 ?float $latitude = null, ?float $longitude = null, ?float $zenith = null, 268 ?float $utcOffset = null): string|int|float|false {} 269 270/** 271 * @refcount 1 272 * @deprecated 273 */ 274function date_sunset( 275 int $timestamp, int $returnFormat = SUNFUNCS_RET_STRING, 276 ?float $latitude = null, ?float $longitude = null, ?float $zenith = null, 277 ?float $utcOffset = null): string|int|float|false {} 278 279/** 280 * @return array<string, bool|int> 281 * @refcount 1 282 */ 283function date_sun_info(int $timestamp, float $latitude, float $longitude): array {} 284 285interface DateTimeInterface 286{ 287 /** @var string */ 288 public const ATOM = DATE_ATOM; 289 /** @var string */ 290 public const COOKIE = DATE_COOKIE; 291 /** @var string */ 292 public const ISO8601 = DATE_ISO8601; 293 /** @var string */ 294 public const ISO8601_EXPANDED = DATE_ISO8601_EXPANDED; 295 /** @var string */ 296 public const RFC822 = DATE_RFC822; 297 /** @var string */ 298 public const RFC850 = DATE_RFC850; 299 /** @var string */ 300 public const RFC1036 = DATE_RFC1036; 301 /** @var string */ 302 public const RFC1123 = DATE_RFC1123; 303 /** @var string */ 304 public const RFC7231 = DATE_RFC7231; 305 /** @var string */ 306 public const RFC2822 = DATE_RFC2822; 307 /** @var string */ 308 public const RFC3339 = DATE_RFC3339; 309 /** @var string */ 310 public const RFC3339_EXTENDED = DATE_RFC3339_EXTENDED; 311 /** @var string */ 312 public const RSS = DATE_RSS; 313 /** @var string */ 314 public const W3C = DATE_W3C; 315 316 /** @tentative-return-type */ 317 public function format(string $format): string; 318 319 /** @tentative-return-type */ 320 public function getTimezone(): DateTimeZone|false; 321 322 /** @tentative-return-type */ 323 public function getOffset(): int; 324 325 /** @tentative-return-type */ 326 public function getTimestamp(): int; 327 328 /** @tentative-return-type */ 329 public function diff(DateTimeInterface $targetObject, bool $absolute = false): DateInterval; 330 331 /** @tentative-return-type */ 332 public function __wakeup(): void; 333 334 public function __serialize(): array; 335 336 public function __unserialize(array $data): void; 337} 338 339class DateTime implements DateTimeInterface 340{ 341 public function __construct(string $datetime = "now", ?DateTimeZone $timezone = null) {} 342 343 public function __serialize(): array {} 344 345 public function __unserialize(array $data): void {} 346 347 /** @tentative-return-type */ 348 public function __wakeup(): void {} 349 350 /** @tentative-return-type */ 351 public static function __set_state(array $array): DateTime {} 352 353 /** @tentative-return-type */ 354 public static function createFromImmutable(DateTimeImmutable $object): static {} 355 356 /** @return static */ 357 public static function createFromInterface(DateTimeInterface $object): DateTime {} // TODO return type should be static 358 359 /** 360 * @tentative-return-type 361 * @alias date_create_from_format 362 */ 363 public static function createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false {} 364 365 /** 366 * @return array<string, int|array>|false 367 * @tentative-return-type 368 * @alias date_get_last_errors 369 */ 370 public static function getLastErrors(): array|false {} 371 372 /** 373 * @tentative-return-type 374 * @alias date_format 375 */ 376 public function format(string $format): string {} 377 378 /** 379 * @tentative-return-type 380 */ 381 public function modify(string $modifier): DateTime|false {} 382 383 /** 384 * @tentative-return-type 385 * @alias date_add 386 */ 387 public function add(DateInterval $interval): DateTime {} 388 389 /** 390 * @tentative-return-type 391 */ 392 public function sub(DateInterval $interval): DateTime {} 393 394 /** 395 * @tentative-return-type 396 * @alias date_timezone_get 397 */ 398 public function getTimezone(): DateTimeZone|false {} 399 400 /** 401 * @tentative-return-type 402 * @alias date_timezone_set 403 */ 404 public function setTimezone(DateTimeZone $timezone): DateTime {} 405 406 /** 407 * @tentative-return-type 408 * @alias date_offset_get 409 */ 410 public function getOffset(): int {} 411 412 /** 413 * @tentative-return-type 414 * @alias date_time_set 415 */ 416 public function setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0): DateTime {} 417 418 /** 419 * @tentative-return-type 420 * @alias date_date_set 421 */ 422 public function setDate(int $year, int $month, int $day): DateTime {} 423 424 /** 425 * @tentative-return-type 426 * @alias date_isodate_set 427 */ 428 public function setISODate(int $year, int $week, int $dayOfWeek = 1): DateTime {} 429 430 /** 431 * @tentative-return-type 432 * @alias date_timestamp_set 433 */ 434 public function setTimestamp(int $timestamp): DateTime {} 435 436 /** 437 * @tentative-return-type 438 * @alias date_timestamp_get 439 */ 440 public function getTimestamp(): int {} 441 442 /** 443 * @tentative-return-type 444 * @alias date_diff 445 */ 446 public function diff(DateTimeInterface $targetObject, bool $absolute = false): DateInterval {} 447} 448 449class DateTimeImmutable implements DateTimeInterface 450{ 451 public function __construct(string $datetime = "now", ?DateTimeZone $timezone = null) {} 452 453 public function __serialize(): array {} 454 455 public function __unserialize(array $data): void {} 456 457 /** @tentative-return-type */ 458 public function __wakeup(): void {} 459 460 /** @tentative-return-type */ 461 public static function __set_state(array $array): DateTimeImmutable {} 462 463 /** 464 * @tentative-return-type 465 * @alias date_create_immutable_from_format 466 */ 467 public static function createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTimeImmutable|false {} 468 469 /** 470 * @return array<string, int|array>|false 471 * @tentative-return-type 472 * @alias date_get_last_errors 473 */ 474 public static function getLastErrors(): array|false {} 475 476 /** 477 * @tentative-return-type 478 * @alias date_format 479 */ 480 public function format(string $format): string {} 481 482 /** 483 * @tentative-return-type 484 * @alias date_timezone_get 485 */ 486 public function getTimezone(): DateTimeZone|false {} 487 488 /** 489 * @tentative-return-type 490 * @alias date_offset_get 491 */ 492 public function getOffset(): int {} 493 494 /** 495 * @tentative-return-type 496 * @alias date_timestamp_get 497 */ 498 public function getTimestamp(): int {} 499 500 /** 501 * @tentative-return-type 502 * @alias date_diff 503 */ 504 public function diff(DateTimeInterface $targetObject, bool $absolute = false): DateInterval {} 505 506 /** @tentative-return-type */ 507 public function modify(string $modifier): DateTimeImmutable|false {} 508 509 /** @tentative-return-type */ 510 public function add(DateInterval $interval): DateTimeImmutable {} 511 512 /** @tentative-return-type */ 513 public function sub(DateInterval $interval): DateTimeImmutable {} 514 515 /** @tentative-return-type */ 516 public function setTimezone(DateTimeZone $timezone): DateTimeImmutable {} 517 518 /** @tentative-return-type */ 519 public function setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0): DateTimeImmutable {} 520 521 /** @tentative-return-type */ 522 public function setDate(int $year, int $month, int $day): DateTimeImmutable {} 523 524 /** @tentative-return-type */ 525 public function setISODate(int $year, int $week, int $dayOfWeek = 1): DateTimeImmutable {} 526 527 /** @tentative-return-type */ 528 public function setTimestamp(int $timestamp): DateTimeImmutable {} 529 530 /** @tentative-return-type */ 531 public static function createFromMutable(DateTime $object): static {} 532 533 /** @return static */ 534 public static function createFromInterface(DateTimeInterface $object): DateTimeImmutable {} // TODO return type should be static 535} 536 537class DateTimeZone 538{ 539 /** 540 * @var int 541 * @cvalue PHP_DATE_TIMEZONE_GROUP_AFRICA 542 */ 543 public const AFRICA = UNKNOWN; 544 /** 545 * @var int 546 * @cvalue PHP_DATE_TIMEZONE_GROUP_AMERICA 547 */ 548 public const AMERICA = UNKNOWN; 549 /** 550 * @var int 551 * @cvalue PHP_DATE_TIMEZONE_GROUP_ANTARCTICA 552 */ 553 public const ANTARCTICA = UNKNOWN; 554 /** 555 * @var int 556 * @cvalue PHP_DATE_TIMEZONE_GROUP_ARCTIC 557 */ 558 public const ARCTIC = UNKNOWN; 559 /** 560 * @var int 561 * @cvalue PHP_DATE_TIMEZONE_GROUP_ASIA 562 */ 563 public const ASIA = UNKNOWN; 564 /** 565 * @var int 566 * @cvalue PHP_DATE_TIMEZONE_GROUP_ATLANTIC 567 */ 568 public const ATLANTIC = UNKNOWN; 569 /** 570 * @var int 571 * @cvalue PHP_DATE_TIMEZONE_GROUP_AUSTRALIA 572 */ 573 public const AUSTRALIA = UNKNOWN; 574 /** 575 * @var int 576 * @cvalue PHP_DATE_TIMEZONE_GROUP_EUROPE 577 */ 578 public const EUROPE = UNKNOWN; 579 /** 580 * @var int 581 * @cvalue PHP_DATE_TIMEZONE_GROUP_INDIAN 582 */ 583 public const INDIAN = UNKNOWN; 584 /** 585 * @var int 586 * @cvalue PHP_DATE_TIMEZONE_GROUP_PACIFIC 587 */ 588 public const PACIFIC = UNKNOWN; 589 /** 590 * @var int 591 * @cvalue PHP_DATE_TIMEZONE_GROUP_UTC 592 */ 593 public const UTC = UNKNOWN; 594 /** 595 * @var int 596 * @cvalue PHP_DATE_TIMEZONE_GROUP_ALL 597 */ 598 public const ALL = UNKNOWN; 599 /** 600 * @var int 601 * @cvalue PHP_DATE_TIMEZONE_GROUP_ALL_W_BC 602 */ 603 public const ALL_WITH_BC = UNKNOWN; 604 /** 605 * @var int 606 * @cvalue PHP_DATE_TIMEZONE_PER_COUNTRY 607 */ 608 public const PER_COUNTRY = UNKNOWN; 609 610 public function __construct(string $timezone) {} 611 612 /** 613 * @tentative-return-type 614 * @alias timezone_name_get 615 */ 616 public function getName(): string {} 617 618 /** 619 * @tentative-return-type 620 * @alias timezone_offset_get 621 */ 622 public function getOffset(DateTimeInterface $datetime): int {} 623 624 /** 625 * @return array<int, array>|false 626 * @tentative-return-type 627 * @alias timezone_transitions_get 628 */ 629 public function getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false {} 630 631 /** 632 * @return array<string, float|string>|false 633 * @tentative-return-type 634 * @alias timezone_location_get 635 */ 636 public function getLocation(): array|false {} 637 638 /** 639 * @return array<string, array> 640 * @tentative-return-type 641 * @alias timezone_abbreviations_list 642 */ 643 public static function listAbbreviations(): array {} 644 645 /** 646 * @return array<int, string> 647 * @tentative-return-type 648 * @alias timezone_identifiers_list 649 */ 650 public static function listIdentifiers(int $timezoneGroup = DateTimeZone::ALL, ?string $countryCode = null): array {} 651 652 public function __serialize(): array {} 653 654 public function __unserialize(array $data): void {} 655 656 /** @tentative-return-type */ 657 public function __wakeup(): void {} 658 659 /** @tentative-return-type */ 660 public static function __set_state(array $array): DateTimeZone {} 661} 662 663class DateInterval 664{ 665 public function __construct(string $duration) {} 666 667 /** 668 * @tentative-return-type 669 */ 670 public static function createFromDateString(string $datetime): DateInterval|false {} 671 672 /** 673 * @tentative-return-type 674 * @alias date_interval_format 675 */ 676 public function format(string $format): string {} 677 678 public function __serialize(): array; 679 680 public function __unserialize(array $data): void; 681 682 /** @tentative-return-type */ 683 public function __wakeup(): void {} 684 685 /** @tentative-return-type */ 686 public static function __set_state(array $array): DateInterval {} 687} 688 689class DatePeriod implements IteratorAggregate 690{ 691 /** 692 * @var int 693 * @cvalue PHP_DATE_PERIOD_EXCLUDE_START_DATE 694 */ 695 public const EXCLUDE_START_DATE = UNKNOWN; 696 /** 697 * @var int 698 * @cvalue PHP_DATE_PERIOD_INCLUDE_END_DATE 699 */ 700 public const INCLUDE_END_DATE = UNKNOWN; 701 702 /** @readonly */ 703 public ?DateTimeInterface $start; 704 /** @readonly */ 705 public ?DateTimeInterface $current; 706 /** @readonly */ 707 public ?DateTimeInterface $end; 708 /** @readonly */ 709 public ?DateInterval $interval; 710 /** @readonly */ 711 public int $recurrences; 712 /** @readonly */ 713 public bool $include_start_date; 714 /** @readonly */ 715 public bool $include_end_date; 716 717 public static function createFromISO8601String(string $specification, int $options = 0): static {} 718 719 /** 720 * @param DateTimeInterface|string $start 721 * @param DateInterval|int $interval 722 * @param DateTimeInterface|int $end 723 * @param int $options 724 */ 725 public function __construct($start, $interval = UNKNOWN, $end = UNKNOWN, $options = UNKNOWN) {} 726 727 /** @tentative-return-type */ 728 public function getStartDate(): DateTimeInterface {} 729 730 /** @tentative-return-type */ 731 public function getEndDate(): ?DateTimeInterface {} 732 733 /** @tentative-return-type */ 734 public function getDateInterval(): DateInterval {} 735 736 /** @tentative-return-type */ 737 public function getRecurrences(): ?int {} 738 739 public function __serialize(): array; 740 741 public function __unserialize(array $data): void; 742 743 /** @tentative-return-type */ 744 public function __wakeup(): void {} 745 746 /** @tentative-return-type */ 747 public static function __set_state(array $array): DatePeriod {} 748 749 public function getIterator(): Iterator {} 750} 751 752/** 753 * @strict-properties 754 */ 755class DateError extends Error 756{ 757} 758 759/** 760 * @strict-properties 761 */ 762class DateObjectError extends DateError 763{ 764} 765 766/** 767 * @strict-properties 768 */ 769class DateRangeError extends DateError 770{ 771} 772 773/** 774 * @strict-properties 775 */ 776class DateException extends Exception 777{ 778} 779 780/** 781 * @strict-properties 782 */ 783class DateInvalidTimeZoneException extends DateException 784{ 785} 786 787/** 788 * @strict-properties 789 */ 790class DateInvalidOperationException extends DateException 791{ 792} 793 794/** 795 * @strict-properties 796 */ 797class DateMalformedStringException extends DateException 798{ 799} 800 801/** 802 * @strict-properties 803 */ 804class DateMalformedIntervalStringException extends DateException 805{ 806} 807 808/** 809 * @strict-properties 810 */ 811class DateMalformedPeriodStringException extends DateException 812{ 813} 814