note 120845 added to migration71.incompatible

From: Date: Tue, 21 Mar 2017 11:49:19 +0000
Subject: note 120845 added to migration71.incompatible
Groups: php.notes 
Request: Send a blank email to php-notes+get-208936@lists.php.net to get a copy of this message
The backwards incompatible change 'The empty index operator is not supported for strings anymore' has a lot more implications than just a fatal error on the following code <?php $a = ""; $a[] = "hello world"; var_dump($a); ?> This will give a fatal error in 7.1 but will work as expected in 7.0 or below and give you: (no notice, no warning) array(1) { [0]=> string(11) "hello world" } However, the following is also changed: <?php $a = ""; $a[0] = "hello world"; var_dump($a); // 7.1: string(1) "h" // pre-7.1: array(1) { [0]=> string(11) "hello world" } $a = ""; $a[5] = "hello world"; var_dump($a); // 7.1: string(6) " h" // pre-7.1: array(1) { [0]=> string(11) "hello world" } ?> ---- Server IP: 72.52.91.14 Probable Submitter: 2001:610:600:8774:48e3:1dff:d1b2:373c ---- Manual Page -- http://php.net/manual/en/migration71.incompatible.php Edit -- https://master.php.net/note/edit/120845 Del: integrated -- https://master.php.net/note/delete/120845/integrated Del: useless -- https://master.php.net/note/delete/120845/useless Del: bad code -- https://master.php.net/note/delete/120845/bad+code Del: spam -- https://master.php.net/note/delete/120845/spam Del: non-english -- https://master.php.net/note/delete/120845/non-english Del: in docs -- https://master.php.net/note/delete/120845/in+docs Del: other reasons-- https://master.php.net/note/delete/120845 Reject -- https://master.php.net/note/reject/120845 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#208936) next »