appendices/migration71/incompatible.xml
19e8122137a1d42ed60f17fe2c0c2b69b0b2d16b
...
...
@@ -143,10 +143,10 @@ Warning: Cannot call func_num_args() dynamically in %s on line %d
143
143
<para>
144
144
<function>mt_rand</function> will now default to using the fixed version of
145
145
the Mersenne Twister algorithm. If deterministic output from
146
-
<function>mt_srand</function> was relied upon, then the
147
-
<constant>MT_RAND_PHP</constant> with the ability to preserve the old
148
-
(incorrect) implementation via an additional optional second parameter to
149
-
<function>mt_srand</function>.
146
+
<function>mt_rand</function> was relied upon, then
147
+
<constant>MT_RAND_PHP</constant> can be used as optional second parameter
148
+
to <function>mt_srand</function> to preserve the old (incorrect)
149
+
implementation.
150
150
</para>
151
151
</sect2>
152
152

...
...
@@ -160,7 +160,7 @@ Warning: Cannot call func_num_args() dynamically in %s on line %d
160
160
<function>rand</function> and <function>srand</function> have now been made
161
161
aliases to <function>mt_rand</function> and <function>mt_srand</function>,
162
162
respectively. This means that the output for the following functions have
163
-
changes: <function>rand</function>, <function>shuffle</function>,
163
+
changed: <function>rand</function>, <function>shuffle</function>,
164
164
<function>str_shuffle</function>, and <function>array_rand</function>.
165
165
</para>
166
166
</sect2>
...
...
@@ -229,6 +229,43 @@ Warning: Cannot call func_num_args() dynamically in %s on line %d
229
229
</para>
230
230
</sect2>
231
231

232
+
<sect2 xml:id="migration71.incompatible.empty-string-modifcation-by-character">
233
+
<title>Assignment via string index access on an empty string</title>
234
+
<para>
235
+
String modification by character on an empty string now works like for non-empty
236
+
strings, i.e. writing to an out of range offset pads the string with spaces,
237
+
where non-integer types are converted to integer, and only the first character of
238
+
the assigned string is used. Formerly, empty strings where silently treated like
239
+
an empty array.
240
+
<informalexample>
241
+
<programlisting role="php">
242
+
<![CDATA[
243
+
<?php
244
+
$a = '';
245
+
$a[10] = 'foo';
246
+
var_dump($a);
247
+
?>
248
+
]]>
249
+
</programlisting>
250
+
&example.outputs.70;
251
+
<screen>
252
+
<![CDATA[
253
+
array(1) {
254
+
[10]=>
255
+
string(3) "foo"
256
+
}
257
+
]]>
258
+
</screen>
259
+
&example.outputs.71;
260
+
<screen>
261
+
<![CDATA[
262
+
string(11) " f"
263
+
]]>
264
+
</screen>
265
+
</informalexample>
266
+
</para>
267
+
</sect2>
268
+

232
269
<sect2 xml:id="migration71.incompatible.removed-ini-directives">
233
270
<title>Removed ini directives</title>
234
271

...
...
@@ -335,7 +372,7 @@ array(2) {
335
372
<para>
336
373
The <literal>allowed_classes</literal> element of the $options parameter of
337
374
<function>unserialize</function> is now strictly typed, i.e. if anything
338
-
other than an <type>array</type> or a <type>boolean</type> is given,
375
+
other than an <type>array</type> or a <type>bool</type> is given,
339
376
unserialize() returns &false; and issues an <constant>E_WARNING</constant>.
340
377
</para>
341
378
</sect2>
...
...
@@ -515,7 +552,7 @@ $f = function ($param) use ($param) {};
515
552
<sect2 xml:id="migration71.incompatible.long2ip">
516
553
<title>long2ip() parameter type change</title>
517
554
<para>
518
-
<function>long2ip()</function> now expects an <type>int</type> instead of a
555
+
<function>long2ip</function> now expects an <type>int</type> instead of a
519
556
<type>string</type>.
520
557
</para>
521
558
</sect2>
...
...
@@ -524,7 +561,7 @@ $f = function ($param) use ($param) {};
524
561
<title>JSON encoding and decoding</title>
525
562
<para>
526
563
The <parameter>serialize_precision</parameter> ini setting now controls the
527
-
serialization precision when encoding doubles.
564
+
serialization precision when encoding <type>float</type>s.
528
565
</para>
529
566
<para>
530
567
Decoding an empty key now results in an empty property name, rather than
...
...
@@ -561,7 +598,7 @@ object(stdClass)#1 (1) {
561
598
parameter semantics
562
599
</title>
563
600
<para>
564
-
The third paramter to the <function>mb_ereg</function> and
601
+
The third parameter to the <function>mb_ereg</function> and
565
602
<function>mb_eregi</function> functions (<parameter>regs</parameter>) will now be
566
603
set to an empty array if nothing was matched. Formerly, the parameter would
567
604
not have been modified.
...
...
@@ -574,6 +611,17 @@ object(stdClass)#1 (1) {
574
611
The sslv2 stream has now been dropped in OpenSSL.
575
612
</para>
576
613
</sect2>
614
+

615
+
<sect2 xml:id="migration71.incompatible.typed-returns-compile-time">
616
+
<title>Forbid "return;" for typed returns already at compile-time</title>
617
+
<para>
618
+
Return statements without argument in functions which declare a return type
619
+
now trigger <constant>E_COMPILE_ERROR</constant> (unless the return type is
620
+
declared as <type>void</type>), even if the return statement would never be
621
+
reached.
622
+
</para>
623
+
</sect2>
624
+

577
625
</sect1>
578
626

579
627
<!-- Keep this comment at the end of the file
580
628