Skip to content

Commit 3a14ce1

Browse files
authored
Fix stubs of DateTimeZone->getTransitions (#17992)
The default value of `timestamp_end` is INT32_MAX and not ZEND_LONG_MAX
1 parent 6eae466 commit 3a14ce1

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Zend/tests/parameter_default_values/internal_declaration_error_const.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ class MyDateTimeZone extends DateTimeZone
1010
}
1111
?>
1212
--EXPECTF--
13-
Fatal error: Declaration of MyDateTimeZone::getTransitions(): array|false must be compatible with DateTimeZone::getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false in %s on line %d
13+
Fatal error: Declaration of MyDateTimeZone::getTransitions(): array|false must be compatible with DateTimeZone::getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = 2147483647): array|false in %s on line %d

ext/date/php_date.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ function timezone_offset_get(DateTimeZone $object, DateTimeInterface $datetime):
227227
* @refcount 1
228228
*/
229229
function timezone_transitions_get(
230-
DateTimeZone $object, int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false {}
230+
DateTimeZone $object, int $timestampBegin = PHP_INT_MIN, int $timestampEnd = 2147483647): array|false {}
231231

232232
/**
233233
* @return array<string, float|string>|false
@@ -615,7 +615,7 @@ public function getOffset(DateTimeInterface $datetime): int {}
615615
* @tentative-return-type
616616
* @alias timezone_transitions_get
617617
*/
618-
public function getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = PHP_INT_MAX): array|false {}
618+
public function getTransitions(int $timestampBegin = PHP_INT_MIN, int $timestampEnd = 2147483647): array|false {}
619619

620620
/**
621621
* @return array<string, float|string>|false

ext/date/php_date_arginfo.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_getDefaultValueConstantName_Internal.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ NULL
4747
NULL
4848
----------
4949
string(11) "PHP_INT_MIN"
50-
string(11) "PHP_INT_MAX"
50+
NULL
5151
----------
5252
string(17) "DateTimeZone::ALL"
5353
NULL

0 commit comments

Comments
 (0)