reference/datetime/functions/date-create-immutable.xml
71692b6f4cace8dca72a18ccd80d4cd7305e5d4e
...
...
@@ -3,14 +3,46 @@
3
3
<refentry xml:id="function.date-create-immutable" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>date_create_immutable</refname>
6
-
<refpurpose>&Alias; <methodname>DateTimeImmutable::__construct</methodname></refpurpose>
6
+
<refpurpose>create a new <classname>DateTimeImmutable</classname> object</refpurpose>
7
7
</refnamediv>
8
8

9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
+
<methodsynopsis>
12
+
<type class="union"><type>DateTimeImmutable</type><type>false</type></type><methodname>date_create_immutable</methodname>
13
+
<methodparam choice="opt"><type>string</type><parameter>datetime</parameter><initializer>"now"</initializer></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>DateTimeZone</type><type>null</type></type><parameter>timezone</parameter><initializer>&null;</initializer></methodparam>
15
+
</methodsynopsis>
11
16
<para>
12
-
&info.function.alias; <methodname>DateTimeImmutable::__construct</methodname>
17
+
This is the procedural version of
18
+
<methodname>DateTimeImmutable::__construct</methodname>.
13
19
</para>
20
+
<para>
21
+
Unlike the <classname>DateTimeImmutable</classname> constructor, it will return
22
+
&false; instead of an exception if the passed in
23
+
<parameter>datetime</parameter> string is invalid.
24
+
</para>
25
+
</refsect1>
26
+

27
+
<refsect1 role="parameters">
28
+
&reftitle.parameters;
29
+
<para>
30
+
See <link linkend="datetimeimmutable.construct">DateTimeImmutable::__construct</link>.
31
+
</para>
32
+
</refsect1>
33
+

34
+
<refsect1 role="returnvalues">
35
+
&reftitle.returnvalues;
36
+
<para>
37
+
Returns a new DateTimeImmutable instance &return.falseforfailure;
38
+
</para>
39
+
</refsect1>
40
+

41
+
<refsect1 role="seealso">
42
+
&reftitle.seealso;
43
+
<simplelist>
44
+
<member><methodname>DateTimeImmutable::createFromFormat</methodname></member>
45
+
</simplelist>
14
46
</refsect1>
15
47

16
48
</refentry>
17
49