Move integer semantic changes into their own file, and flesh them out.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337355 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Adam Harvey 2015-08-09 01:16:10 +00:00
parent 9a4e00c8f0
commit 9b0502b2dd
3 changed files with 81 additions and 10 deletions

View file

@ -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;

View file

@ -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
-->

View file

@ -79,16 +79,6 @@ function foo($a, $b, $unused, $unused) {
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