|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<!-- $Revision$ --> |
| 3 | +<refentry xml:id="datetime.unserialize" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> |
| 4 | + <refnamediv> |
| 5 | + <refname>DateTime::__unserialize</refname> |
| 6 | + <refname>DateTimeImmutable::__unserialize</refname> |
| 7 | + <refname>DateTimeInterface::__unserialize</refname> |
| 8 | + <refpurpose>Unserialize an Datetime</refpurpose> |
| 9 | + </refnamediv> |
| 10 | + |
| 11 | + <refsect1 role="description"> |
| 12 | + &reftitle.description; |
| 13 | + <methodsynopsis role="DateTime"> |
| 14 | + <modifier>public</modifier> <type>void</type><methodname>DateTime::__unserialize</methodname> |
| 15 | + <methodparam><type>array</type><parameter>data</parameter></methodparam> |
| 16 | + </methodsynopsis> |
| 17 | + <methodsynopsis role="DateTimeImmutable"> |
| 18 | + <modifier>public</modifier> <type>void</type><methodname>DateTimeImmutable::__unserialize</methodname> |
| 19 | + <methodparam><type>array</type><parameter>data</parameter></methodparam> |
| 20 | + </methodsynopsis> |
| 21 | + <methodsynopsis role="DateTimeInterface"> |
| 22 | + <modifier>public</modifier> <type>void</type><methodname>DateTimeInterface::__unserialize</methodname> |
| 23 | + <methodparam><type>array</type><parameter>data</parameter></methodparam> |
| 24 | + </methodsynopsis> |
| 25 | + <para> |
| 26 | + The <link linkend="object.unserialize">__unserialize()</link> handler. |
| 27 | + </para> |
| 28 | + </refsect1> |
| 29 | + |
| 30 | + <refsect1 role="parameters"> |
| 31 | + &reftitle.parameters; |
| 32 | + <variablelist> |
| 33 | + <varlistentry> |
| 34 | + <term><parameter>data</parameter></term> |
| 35 | + <listitem> |
| 36 | + <para> |
| 37 | + The serialized <classname>DateTime</classname>. |
| 38 | + </para> |
| 39 | + </listitem> |
| 40 | + </varlistentry> |
| 41 | + </variablelist> |
| 42 | + </refsect1> |
| 43 | + |
| 44 | + <refsect1 role="returnvalues"> |
| 45 | + &reftitle.returnvalues; |
| 46 | + <para> |
| 47 | + The <classname>DateTime</classname> object. |
| 48 | + </para> |
| 49 | + </refsect1> |
| 50 | + |
| 51 | + <refsect1 role="examples"> |
| 52 | + &reftitle.examples; |
| 53 | + <example> |
| 54 | + <title><function>DateTime::unserialize</function> example</title> |
| 55 | + <programlisting role="php"> |
| 56 | +<![CDATA[ |
| 57 | +<?php |
| 58 | +$serializedDate = 'O:8:"DateTime":3:{s:4:"date";s:26:"2025-03-27 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}'; |
| 59 | +var_dump(unserialize($serializedDate)); |
| 60 | +?> |
| 61 | +]]> |
| 62 | + </programlisting> |
| 63 | + &examples.outputs; |
| 64 | + <screen> |
| 65 | +<![CDATA[ |
| 66 | +object(DateTime)#1 (3) { |
| 67 | + ["date"]=> |
| 68 | + string(26) "2025-03-27 00:00:00.000000" |
| 69 | + ["timezone_type"]=> |
| 70 | + int(3) |
| 71 | + ["timezone"]=> |
| 72 | + string(3) "UTC" |
| 73 | +} |
| 74 | +]]> |
| 75 | + </screen> |
| 76 | + </example> |
| 77 | + </refsect1> |
| 78 | + |
| 79 | + <refsect1 role="seealso"> |
| 80 | + &reftitle.seealso; |
| 81 | + <simplelist> |
| 82 | + <member><methodname>DateTime::__serialize</methodname></member> |
| 83 | + </simplelist> |
| 84 | + </refsect1> |
| 85 | +</refentry> |
| 86 | +<!-- Keep this comment at the end of the file |
| 87 | +Local variables: |
| 88 | +mode: sgml |
| 89 | +sgml-omittag:t |
| 90 | +sgml-shorttag:t |
| 91 | +sgml-minimize-attributes:nil |
| 92 | +sgml-always-quote-attributes:t |
| 93 | +sgml-indent-step:1 |
| 94 | +sgml-indent-data:t |
| 95 | +indent-tabs-mode:nil |
| 96 | +sgml-parent-document:nil |
| 97 | +sgml-default-dtd-file:"~/.phpdoc/manual.ced" |
| 98 | +sgml-exposed-tags:nil |
| 99 | +sgml-local-catalogs:nil |
| 100 | +sgml-local-ecat-files:nil |
| 101 | +End: |
| 102 | +vim600: syn=xml fen fdm=syntax fdl=2 si |
| 103 | +vim: et tw=78 syn=sgml |
| 104 | +vi: ts=1 sw=1 |
| 105 | +--> |
0 commit comments