Skip to content

Commit 969c786

Browse files
Add missing 8.0.0 changelog for datetime functions no longer returning false
In PHP 7.x, several datetime functions returned `false` on parameter parsing failure. PHP 8.0 changed this to throw `TypeError` instead (per RFC: Consistent type errors for internal functions). This changelog entry was already documented for `DateTimeZone::listIdentifiers`/`timezone_identifiers_list`, but was missing from the following functions: - `date()` - `gmdate()` - `localtime()` - `getdate()` - `date_parse()` - `date_parse_from_format()` - `date_sun_info()` Functions that still return `false` from their own logic (e.g. `strtotime()`, `mktime()`, `date_create()`) are not included, as the parameter parsing change is not observable in their return types. The issue also requests reverting the return value description to mention `false`, but the old text was inaccurate (non-numeric strings were coerced to `0`, not rejected) and was intentionally removed in GH-2130. Closes #5460
1 parent ddc2a2d commit 969c786

File tree

7 files changed

+49
-0
lines changed

7 files changed

+49
-0
lines changed

reference/datetime/functions/date-parse-from-format.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@
123123
ignored.
124124
</entry>
125125
</row>
126+
<row>
127+
<entry>8.0.0</entry>
128+
<entry>
129+
This function no longer returns &false; on failure, but throws a
130+
<classname>TypeError</classname> instead.
131+
</entry>
132+
</row>
126133
<row>
127134
<entry>7.2.0</entry>
128135
<entry>

reference/datetime/functions/date-parse.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@
124124
</row>
125125
</thead>
126126
<tbody>
127+
<row>
128+
<entry>8.0.0</entry>
129+
<entry>
130+
This function no longer returns &false; on failure, but throws a
131+
<classname>TypeError</classname> instead.
132+
</entry>
133+
</row>
127134
<row>
128135
<entry>7.2.0</entry>
129136
<entry>

reference/datetime/functions/date-sun-info.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@
154154
</row>
155155
</thead>
156156
<tbody>
157+
<row>
158+
<entry>8.0.0</entry>
159+
<entry>
160+
This function no longer returns &false; on failure, but throws a
161+
<classname>TypeError</classname> instead.
162+
</entry>
163+
</row>
157164
<row>
158165
<entry>7.2.0</entry>
159166
<entry>

reference/datetime/functions/date.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@
8181
</row>
8282
</thead>
8383
<tbody>
84+
<row>
85+
<entry>8.0.0</entry>
86+
<entry>
87+
This function no longer returns &false; on failure, but throws a
88+
<classname>TypeError</classname> instead.
89+
</entry>
90+
</row>
8491
<row>
8592
<entry>8.0.0</entry>
8693
<entry>

reference/datetime/functions/getdate.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@
128128
</row>
129129
</thead>
130130
<tbody>
131+
<row>
132+
<entry>8.0.0</entry>
133+
<entry>
134+
This function no longer returns &false; on failure, but throws a
135+
<classname>TypeError</classname> instead.
136+
</entry>
137+
</row>
131138
<row>
132139
<entry>8.0.0</entry>
133140
<entry>

reference/datetime/functions/gmdate.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@
5858
</row>
5959
</thead>
6060
<tbody>
61+
<row>
62+
<entry>8.0.0</entry>
63+
<entry>
64+
This function no longer returns &false; on failure, but throws a
65+
<classname>TypeError</classname> instead.
66+
</entry>
67+
</row>
6168
<row>
6269
<entry>8.0.0</entry>
6370
<entry>

reference/datetime/functions/localtime.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@
124124
</row>
125125
</thead>
126126
<tbody>
127+
<row>
128+
<entry>8.0.0</entry>
129+
<entry>
130+
This function no longer returns &false; on failure, but throws a
131+
<classname>TypeError</classname> instead.
132+
</entry>
133+
</row>
127134
<row>
128135
<entry>8.0.0</entry>
129136
<entry>

0 commit comments

Comments
 (0)