svn: /phpdoc/en/trunk/appendices/migration70/ incompatible/integers.xml incompatible/other.xml incompatible.xml
| From: | Adam Harvey | Date: | Sun, 09 Aug 2015 01:16:10 +0000 |
| Subject: | svn: /phpdoc/en/trunk/appendices/migration70/ incompatible/integers.xml incompatible/other.xml incompatible.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-13538@lists.php.net to get a copy of this message | ||
aharvey Sun, 09 Aug 2015 01:16:10 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=337355
Log:
Move integer semantic changes into their own file, and flesh them out.
Changed paths:
A phpdoc/en/trunk/appendices/migration70/incompatible/integers.xml
U phpdoc/en/trunk/appendices/migration70/incompatible/other.xml
U phpdoc/en/trunk/appendices/migration70/incompatible.xml
Added: phpdoc/en/trunk/appendices/migration70/incompatible/integers.xml
===================================================================
--- phpdoc/en/trunk/appendices/migration70/incompatible/integers.xml (rev 0)
+++ phpdoc/en/trunk/appendices/migration70/incompatible/integers.xml 2015-08-09 01:16:10 UTC (rev
337355)
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+
+<sect2 xml:id="migration70.incompatible.integers">
+ <title>Changes to <type>integer</type> handling</title>
+
+ <sect3 xml:id="migration70.incompatible.integers.invalid-octals">
+ <title>Invalid octal literals</title>
+
+ <para>
+ Previously, octal literals that contained invalid numbers were silently
+ truncated (<literal>0128</literal> was taken as <literal>012</literal>).
+ Now, an invalid octal literal will cause a parse error.
+ </para>
+ </sect3>
+
+ <sect3 xml:id="migration70.incompatible.integers.negative-bitshift">
+ <title>Negative bitshifts</title>
+
+ <para>
+ Bitwise shifts by negative numbers will now throw an
+ <classname>ArithmeticError</classname>:
+ </para>
+ <informalexample>
+ <programlisting role="php">
+<![CDATA[
+<?php
+var_dump(1 >> -1);
+?>
+]]>
+ </programlisting>
+ &example.outputs.5;
+ <screen>
+<![CDATA[
+int(0)
+]]>
+ </screen>
+ &example.outputs.7;
+ <screen>
+<![CDATA[
+Fatal error: Uncaught ArithmeticError: Bit shift by negative number in /tmp/test.php:2
+Stack trace:
+#0 {main}
+ thrown in /tmp/test.php on line 2
+]]>
+ </screen>
+ </informalexample>
+ </sect3>
+
+ <sect3 xml:id="migration70.incompatible.integers.out-of-range">
+ <title>Out of range bitshifts</title>
+
+ <para>
+ Bitwise shifts (in either direction) beyond the bit width of an
+ <type>integer</type> will always result in 0. Previously, the behaviour of
+ such shifts was architecture dependent.
+ </para>
+ </sect3>
+</sect2>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"~/.phpdoc/manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->
Modified: phpdoc/en/trunk/appendices/migration70/incompatible/other.xml
===================================================================
--- phpdoc/en/trunk/appendices/migration70/incompatible/other.xml 2015-08-09 01:16:05 UTC (rev
337354)
+++ phpdoc/en/trunk/appendices/migration70/incompatible/other.xml 2015-08-09 01:16:10 UTC (rev
337355)
@@ -79,16 +79,6 @@
removed. <literal>;</literal> should be used instead.
</para>
</sect3>
-
- <sect3 xml:id="migration70.incompatible.other.invalid-octals">
- <title>Invalid octal literals</title>
-
- <para>
- Previously, octal literals that contained invalid numbers were silently
- truncated (<literal>0128</literal> was taken as <literal>012</literal>).
- Now, an invalid octal literal will cause a parse error.
- </para>
- </sect3>
</sect2>
<!-- Keep this comment at the end of the file
Modified: phpdoc/en/trunk/appendices/migration70/incompatible.xml
===================================================================
--- phpdoc/en/trunk/appendices/migration70/incompatible.xml 2015-08-09 01:16:05 UTC (rev 337354)
+++ phpdoc/en/trunk/appendices/migration70/incompatible.xml 2015-08-09 01:16:10 UTC (rev 337355)
@@ -6,6 +6,7 @@
&appendices.migration70.incompatible.variable-handling;
&appendices.migration70.incompatible.foreach;
+ &appendices.migration70.incompatible.integers;
&appendices.migration70.incompatible.removed-functions;
&appendices.migration70.incompatible.removed-ini-directives;
&appendices.migration70.incompatible.other;