php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #72718 PHP 5.6 doesn't strict/deprecated warn for uniform variable syntax changes
Submitted: 2016-07-31 10:08 UTC Modified: 2016-07-31 11:04 UTC
From: spam2 at rhsoft dot net Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 7.0.9 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: spam2 at rhsoft dot net
New email:
PHP Version: OS:

 

 [2016-07-31 10:08 UTC] spam2 at rhsoft dot net
Description:
------------
$count = $GLOBALS['cl_api']->$module['api_name']->count(0);
$count = $GLOBALS['cl_api']->{$module['api_name']}->count(0);

why in the world is the first a "array to string conversion" with PHP7
$module['api_name'] is clearly a field of a array and a string

while i suck all the changes in context of $$ that above is somehow unacceptable because there is hardly some clean way to seek for such things since seek for ]-> would also find any of similar but fine code and seek for ]->$ the same


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-31 10:13 UTC] spam2 at rhsoft dot net
AND AT LEAST there should have been done something in 5.6 to WARN about such needed changes without beraking applications at that point
 [2016-07-31 10:14 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: PHP Language Specification +Package: Scripting Engine problem
 [2016-07-31 10:14 UTC] requinix@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You'd think a change like that would be documented, right?
http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.variable-handling
 [2016-07-31 10:15 UTC] spam2 at rhsoft dot net
IT IS A BUG not have any deprecation warnings running hundrets of websites on PHP 5.6 with error reporting E_ALL
 [2016-07-31 10:26 UTC] requinix@php.net
-Summary: PHP7: array to string conversion +Summary: PHP 5.6 doesn't strict/deprecated warn for uniform variable syntax changes -Status: Not a bug +Status: Open -Type: Bug +Type: Feature/Change Request
 [2016-07-31 10:26 UTC] requinix@php.net
I suspect it's not even possible to do this, but I'd rather not spend my time arguing with you.
 [2016-07-31 10:40 UTC] nikic@php.net
-Status: Open +Status: Wont fix
 [2016-07-31 10:40 UTC] nikic@php.net
We're not going to introduce posthumous deprecations on a *stable* branch.
 [2016-07-31 10:49 UTC] spam2 at rhsoft dot net
congratulations, so deploy PHP7 will be some sort of "go ahead and look what breaks" since testing every line of code and action on staging systems is just utopic
 [2016-07-31 11:04 UTC] nikic@php.net
From your comments I deduce that you do not have an automated test suite that would alleviate this problem. In that case, may I suggest the use of one of the many PHP 7 compatibility checkers out there? From a quick look, https://github.com/sstalle/php7cc has code that accurately detects syntax affected by UVS changes.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 06:01:28 2024 UTC