Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Upgrade: Compatibility issues found in 000-debug #1849

Closed
shantanu2704 opened this issue Nov 13, 2020 · 5 comments
Closed

PHP Upgrade: Compatibility issues found in 000-debug #1849

shantanu2704 opened this issue Nov 13, 2020 · 5 comments

Comments

@shantanu2704
Copy link
Contributor

The following issues were found when scanning branch master for compatibility problems:

  • Warning in 000-debug/logger.php: Since PHP 7.0, functions inspecting arguments, like func_get_args(), no longer report the original value as passed to a parameter, but will instead provide the current value. The parameter "$stuff" was used, and possibly changed (by reference), on line 41.

    foreach ( func_get_args() as $arg )

  • Warning in 000-debug/logger.php: Since PHP 7.0, functions inspecting arguments, like debug_backtrace(), no longer report the original value as passed to a parameter, but will instead provide the current value. The parameter "$stuff" was used, and possibly changed (by reference), on line 41.

    $backtrace = debug_backtrace(false);

  • Warning in 000-debug/logger.php: Since PHP 7.0, functions inspecting arguments, like debug_backtrace(), no longer report the original value as passed to a parameter, but will instead provide the current value. The parameter "$stuff" was used, and possibly changed (by reference), on line 41.

    $backtrace = debug_backtrace(false);

  • Warning in 000-debug/logger.php: Since PHP 7.0, functions inspecting arguments, like func_get_args(), no longer report the original value as passed to a parameter, but will instead provide the current value. The parameter "$stuff" was used, and possibly changed (by reference), on line 113.

    $args = func_get_args();

This is an automated report.

@GaryJones
Copy link
Contributor

Lines 41 and 113 is simply return $stuff;, so that seems like a fixable false positive cc @jrfnl

@jrfnl
Copy link

jrfnl commented Nov 13, 2020

@GaryJones In the current version of PHPCompatibility line 46 would already no longer be reported. Would you mind opening an issue about the code sample for the lo() function (line 113/115) in PHPCompatibility ?

@pschoffer
Copy link
Contributor

@jrfnl thanks for a quick reply! We are using PhpCompatibility 9.3.5, which seems to be the current that generates these issues.

In both cases (line 46 and 113) the issue seems to be the conditional return statement before func_get_args. I created an issue as you asked.

@pschoffer
Copy link
Contributor

@shantanu2704 same goes for the other two warnings in this file. It is harder to detect there programmatically, but the $stuff value is only used in read-only context, meaning it is not a compatibility issue. I will continue to clean the code which should remove this and others warning in the future, but it should not be a blocker.

@pschoffer
Copy link
Contributor

This was now addressed in #1919

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants