svn: /phpdoc/en/trunk/reference/json/functions/ json-decode.xml

From: Date: Sat, 22 May 2010 11:32:54 +0000
Subject: svn: /phpdoc/en/trunk/reference/json/functions/ json-decode.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-6707@lists.php.net to get a copy of this message
pollita Sat, 22 May 2010 11:32:54 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=299623 Log: Document new parameter to json_decode() Changed paths: U phpdoc/en/trunk/reference/json/functions/json-decode.xml Modified: phpdoc/en/trunk/reference/json/functions/json-decode.xml =================================================================== --- phpdoc/en/trunk/reference/json/functions/json-decode.xml 2010-05-22 09:33:18 UTC (rev 299622) +++ phpdoc/en/trunk/reference/json/functions/json-decode.xml 2010-05-22 11:32:54 UTC (rev 299623) @@ -13,6 +13,7 @@ <methodparam><type>string</type><parameter>json</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>assoc</parameter><initializer>false</initializer></methodparam> <methodparam choice="opt"><type>int</type><parameter>depth</parameter><initializer>512</initializer></methodparam> + <methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam> </methodsynopsis> <para> Takes a JSON encoded string and converts it into a PHP variable. @@ -48,6 +49,16 @@ </para> </listitem> </varlistentry> + <varlistentry> + <term><parameter>options</parameter></term> + <listitem> + <para> + Bitmask of JSON decode options. Currently only + <constant>JSON_BIGINT_AS_STRING</constant> + is supported (default is to cast large integers as floats) + </para> + </listitem> + </varlistentry> </variablelist> </para> </refsect1> @@ -64,6 +75,30 @@ </para> </refsect1> +<refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.4.0</entry> + <entry> + The <parameter>options</parameter> parameter was added. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + <refsect1 role="examples"> &reftitle.examples; <para> @@ -207,6 +242,27 @@ ]]> </screen> </example> + <example> + <title><function>json_decode</function> of large integers</title> + <programlisting role="php"> +<![CDATA[ +<?php +$json = '12345678901234567890'; + +var_dump(json_decode($json)); +var_dump(json_decode($json, false, 512, JSON_BIGINT_AS_STRING)); + +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +float(1.2345678901235E+19) +string(20) "12345678901234567890" +]]> + </screen> + </example> </para> </refsect1>

« previous php.doc.cvs (#6707) next »