reference/datetime/functions/gmmktime.xml
57e27d2a7615da2ee6de57ed27eb40b473d487cb
...
...
@@ -9,14 +9,13 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>int</type><methodname>gmmktime</methodname>
13
-
<methodparam choice="opt"><type>int</type><parameter>hour</parameter><initializer>gmdate("H")</initializer></methodparam>
14
-
<methodparam choice="opt"><type>int</type><parameter>minute</parameter><initializer>gmdate("i")</initializer></methodparam>
15
-
<methodparam choice="opt"><type>int</type><parameter>second</parameter><initializer>gmdate("s")</initializer></methodparam>
16
-
<methodparam choice="opt"><type>int</type><parameter>month</parameter><initializer>gmdate("n")</initializer></methodparam>
17
-
<methodparam choice="opt"><type>int</type><parameter>day</parameter><initializer>gmdate("j")</initializer></methodparam>
18
-
<methodparam choice="opt"><type>int</type><parameter>year</parameter><initializer>gmdate("Y")</initializer></methodparam>
19
-
<methodparam choice="opt"><type>int</type><parameter>is_dst</parameter><initializer>-1</initializer></methodparam>
12
+
<type class="union"><type>int</type><type>false</type></type><methodname>gmmktime</methodname>
13
+
<methodparam><type>int</type><parameter>hour</parameter></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>minute</parameter><initializer>&null;</initializer></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>second</parameter><initializer>&null;</initializer></methodparam>
16
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>month</parameter><initializer>&null;</initializer></methodparam>
17
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>day</parameter><initializer>&null;</initializer></methodparam>
18
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>year</parameter><initializer>&null;</initializer></methodparam>
20
19
</methodsynopsis>
21
20
<para>
22
21
Identical to <function>mktime</function> except the passed parameters represents a
...
...
@@ -24,10 +23,15 @@
24
23
so only times valid in derived local time can be used.
25
24
</para>
26
25
<para>
27
-
Like <function>mktime</function>, arguments may be left out in order
28
-
from right to left, with any omitted arguments being set to the
26
+
Like <function>mktime</function>, optional arguments may be left out in
27
+
order from right to left, with any omitted arguments being set to the
29
28
current corresponding GMT value.
30
29
</para>
30
+
<simpara>
31
+
Calling <function>gmmktime</function> without any arguments is not
32
+
supported, and will result in an <classname>ArgumentCountError</classname>.
33
+
<function>time</function> can be used to get the current timestamp.
34
+
</simpara>
31
35
</refsect1>
32
36

33
37
<refsect1 role="parameters">
...
...
@@ -95,20 +99,6 @@
95
99
</para>
96
100
</listitem>
97
101
</varlistentry>
98
-
<varlistentry>
99
-
<term><parameter>is_dst</parameter></term>
100
-
<listitem>
101
-
<para>
102
-
Parameters always represent a GMT date so <parameter>is_dst</parameter>
103
-
doesn't influence the result.
104
-
</para>
105
-
<note>
106
-
<para>
107
-
This parameter has been removed in PHP 7.0.0.
108
-
</para>
109
-
</note>
110
-
</listitem>
111
-
</varlistentry>
112
102
</variablelist>
113
103
</para>
114
104
</refsect1>
...
...
@@ -116,7 +106,8 @@
116
106
<refsect1 role="returnvalues">
117
107
&reftitle.returnvalues;
118
108
<para>
119
-
Returns a <type>integer</type> Unix timestamp.
109
+
Returns a <type>int</type> Unix timestamp on success, or &false; if the
110
+
timestamp doesn't fit in a PHP integer.
120
111
</para>
121
112
</refsect1>
122
113

...
...
@@ -133,17 +124,17 @@
133
124
</thead>
134
125
<tbody>
135
126
<row>
136
-
<entry>7.0.0</entry>
127
+
<entry>8.0.0</entry>
137
128
<entry>
138
-
<parameter>is_dst</parameter> parameter has been removed.
129
+
<parameter>hour</parameter> is no longer optional. If you need a Unix
130
+
timestamp, use <function>time</function>.
139
131
</entry>
140
132
</row>
141
133
<row>
142
-
<entry>5.1.0</entry>
134
+
<entry>8.0.0</entry>
143
135
<entry>
144
-
As of PHP 5.1.0, the <parameter>is_dst</parameter> parameter became
145
-
deprecated. As a result, the new timezone handling features should be used
146
-
instead.
136
+
<parameter>minute</parameter>, <parameter>second</parameter>, <parameter>month</parameter>,
137
+
<parameter>day</parameter> and <parameter>year</parameter> are nullable now.
147
138
</entry>
148
139
</row>
149
140
</tbody>
...
...
@@ -173,6 +164,7 @@ echo "July 1, 2000 is on a " . date("l", gmmktime(0, 0, 0, 7, 1, 2000));
173
164
&reftitle.seealso;
174
165
<para>
175
166
<simplelist>
167
+
<member>The <classname>DateTimeImmutable</classname> class</member>
176
168
<member><function>mktime</function></member>
177
169
<member><function>date</function></member>
178
170
<member><function>time</function></member>
...
...
@@ -180,7 +172,6 @@ echo "July 1, 2000 is on a " . date("l", gmmktime(0, 0, 0, 7, 1, 2000));
180
172
</para>
181
173
</refsect1>
182
174
</refentry>
183
-

184
175
<!-- Keep this comment at the end of the file
185
176
Local variables:
186
177
mode: sgml
187
178