svn: /phpdoc/en/trunk/ language-snippets.ent reference/var/functions/empty.xml reference/var/functions/isset.xml

From: Date: Fri, 13 Jan 2012 05:36:48 +0000
Subject: svn: /phpdoc/en/trunk/ language-snippets.ent reference/var/functions/empty.xml reference/var/functions/isset.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-9447@lists.php.net to get a copy of this message
danielc Fri, 13 Jan 2012 05:36:48 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=322174 Log: One step in the process of documenting string offset changes. Changed paths: U phpdoc/en/trunk/language-snippets.ent U phpdoc/en/trunk/reference/var/functions/empty.xml U phpdoc/en/trunk/reference/var/functions/isset.xml Modified: phpdoc/en/trunk/language-snippets.ent =================================================================== --- phpdoc/en/trunk/language-snippets.ent 2012-01-13 05:26:12 UTC (rev 322173) +++ phpdoc/en/trunk/language-snippets.ent 2012-01-13 05:36:48 UTC (rev 322174) @@ -253,6 +253,10 @@ <!ENTITY example.outputs '<para xmlns="http://docbook.org/ns/docbook">The above example will output:</para>'> +<!ENTITY example.outputs.53 '<para xmlns="http://docbook.org/ns/docbook">Output of the above example in PHP 5.3:</para>'> + +<!ENTITY example.outputs.54 '<para xmlns="http://docbook.org/ns/docbook">Output of the above example in PHP 5.4:</para>'> + <!ENTITY example.outputs.32bit '<para xmlns="http://docbook.org/ns/docbook">Output of the above example on 32 bit machines:</para>'> <!ENTITY example.outputs.64bit '<para xmlns="http://docbook.org/ns/docbook">Output of the above example on 64 bit machines:</para>'> Modified: phpdoc/en/trunk/reference/var/functions/empty.xml =================================================================== --- phpdoc/en/trunk/reference/var/functions/empty.xml 2012-01-13 05:26:12 UTC (rev 322173) +++ phpdoc/en/trunk/reference/var/functions/empty.xml 2012-01-13 05:36:48 UTC (rev 322174) @@ -75,6 +75,14 @@ </thead> <tbody> <row> + <entry>5.4.0</entry> + <entry> + <para> + Checking non-numeric offsets of strings returns &true;. + </para> + </entry> + </row> + <row> <entry>5.0.0</entry> <entry> <para> @@ -114,6 +122,48 @@ </programlisting> </example> </para> + <example> + <title><function>empty</function> on String Offsets</title> + <para> + PHP 5.4 changes how <function>empty</function> behaves + when passed string offsets. + </para> + <programlisting role="php"> +<![CDATA[ +<?php +$expected_array_got_string = 'somestring'; +var_dump(empty($expected_array_got_string['some_key'])); +var_dump(empty($expected_array_got_string[0])); +var_dump(empty($expected_array_got_string['0'])); +var_dump(empty($expected_array_got_string[0.5])); +var_dump(empty($expected_array_got_string['0.5'])); +var_dump(empty($expected_array_got_string['0 Mostel'])); +?> +]]> + </programlisting> + &example.outputs.53; + <screen> +<![CDATA[ +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +bool(false) +]]> + </screen> + &example.outputs.54; + <screen> +<![CDATA[ +bool(true) +bool(false) +bool(false) +bool(false) +bool(true) +bool(true) +]]> + </screen> + </example> </refsect1> <refsect1 role="notes"> &reftitle.notes; Modified: phpdoc/en/trunk/reference/var/functions/isset.xml =================================================================== --- phpdoc/en/trunk/reference/var/functions/isset.xml 2012-01-13 05:26:12 UTC (rev 322173) +++ phpdoc/en/trunk/reference/var/functions/isset.xml 2012-01-13 05:36:48 UTC (rev 322174) @@ -61,6 +61,32 @@ </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> + <para> + Checking non-numeric offsets of strings now returns &false;. + </para> + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + <refsect1 role="examples"> &reftitle.examples; <para> @@ -126,6 +152,48 @@ </programlisting> </informalexample> </para> + <example> + <title><function>isset</function> on String Offsets</title> + <para> + PHP 5.4 changes how <function>isset</function> behaves + when passed string offsets. + </para> + <programlisting role="php"> +<![CDATA[ +<?php +$expected_array_got_string = 'somestring'; +var_dump(isset($expected_array_got_string['some_key'])); +var_dump(isset($expected_array_got_string[0])); +var_dump(isset($expected_array_got_string['0'])); +var_dump(isset($expected_array_got_string[0.5])); +var_dump(isset($expected_array_got_string['0.5'])); +var_dump(isset($expected_array_got_string['0 Mostel'])); +?> +]]> + </programlisting> + &example.outputs.53; + <screen> +<![CDATA[ +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +]]> + </screen> + &example.outputs.54; + <screen> +<![CDATA[ +bool(false) +bool(true) +bool(true) +bool(true) +bool(false) +bool(false) +]]> + </screen> + </example> </refsect1> <refsect1 role="notes">

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