Bug->Doc #70095 [Nab->Asn]: Operator precedence changed in PHP 7
| From: | pasindu@php.net | Date: | Sat, 18 Jul 2015 16:37:30 +0000 |
| Subject: | Bug->Doc #70095 [Nab->Asn]: Operator precedence changed in PHP 7 | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12532@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70095&edit=1
ID: 70095
Updated by: pasindu@php.net
Reported by: me at evertpot dot com
Summary: Operator precedence changed in PHP 7
-Status: Not a bug
+Status: Assigned
-Type: Bug
+Type: Documentation Problem
Package: Scripting Engine problem
Operating System: Any
PHP Version: 7.0.0beta1
-Assigned To:
+Assigned To: pasindu
Block user comment: N
Private report: N
New Comment:
This is probably not documented, TODO for documentation
Previous Comments:
------------------------------------------------------------------------
[2015-07-18 16:19:14] requinix@php.net
Yes, it's intentional. https://wiki.php.net/rfc/uniform_variable_syntax
------------------------------------------------------------------------
[2015-07-18 16:14:49] me at evertpot dot com
Description:
------------
The code from the description now has a different output. I'm not sure if it's
intentional, so I decided to post it as a bug. It's definitely a BC change.
Also see:
http://3v4l.org/pE0UN
Test script:
---------------
<?php
$foo = [
'a' => 'b'
];
$bar = [
'b' => 'c'
];
$bar = (object)$bar;
// Note that the following line is interpreted as
// $bar->b in PHP < 7, and $bar->Array in PHP > 7.
echo $bar->$foo['a'];
Expected result:
----------------
c
Actual result:
--------------
Notice: Array to string conversion in /in/pE0UN on line 14 Notice: Undefined property:
stdClass::$Array in /in/pE0UN on line 14
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70095&edit=1