File: /www/htdocs/sites/all/modules/contrib/ctools/plugins/export_ui/ctools_export_ui.class.php
    Line 669: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();
    Line 705: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();
    Line 759: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();
    Line 1264: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args(); 

Comments

StephenRobinson created an issue. See original summary.

stephenrobinson’s picture

Issue tags: +PHP 7.0 (duplicate)
joelpittet’s picture

Version: 7.x-1.14 » 7.x-1.x-dev
Status: Active » Postponed (maintainer needs more info)

Please let us know in the issue summary the steps to reproduce this Warning as many have not reported it yet and I've not seen it personally.

Also we usually put the version to the -dev release as that is where we may have fixed it already so please test this against the 7.x-1.x-dev branch to ensure it hasn't already been fixed.

Googling that error it looks like it may be a false positive: https://github.com/sstalle/php7cc/issues/127

jweowu’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new4.34 KB

On account of the backwards-incompatible changes made in PHP 7.0, it's helpful to move any calls to func_get_arg() and func_get_args() to the start of the function (even when the original location was safe in practice), in order to reduce cognitive load for the reader.

Refer to https://secure.php.net/manual/en/migration70.incompatible.php#migration7...

This patch addresses all such instances in ctools with the exception of ctools_access_menu(), in which I judged that the call was so close to the start (and obviously fine) that it was better to leave it as-is.

(I'm happy to re-roll with that instance edited as well, though.)

  • joelpittet committed 56e0574 on 7.x-1.x authored by jweowu
    Issue #3006202 by jweowu, StephenRobinson: Error with PHP7
    
joelpittet’s picture

Status: Needs review » Fixed

Thanks for the patch and the explanation @4jweowu. I've committed your patch to the -dev branch.

joelpittet’s picture

This fix ensures those args are working the same way they were in PHP 5.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

sudheeshps’s picture

@joelpittet, any idea when this will be added to a stable release?

joelpittet’s picture

Good question, we usually plan around an issue like this: #2984057: Plan for CTools 7.x-1.15 release

joelpittet’s picture

gmario’s picture

StatusFileSize
new4.32 KB

Hi, for ctools 7.x-1.12 the patch in #4 does not apply, here a new one with little fixes.

loon’s picture

Version: 7.x-1.x-dev » 7.x-1.15
StatusFileSize
new1.15 KB

On the last version 7.15 I found the same issues:

File: sites/all/modules/contrib/ctools/page_manager/plugins/tasks/search.inc
> Line 102: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();

File: sites/all/modules/contrib/ctools/ctools.module
> Line 912: [Warning] Function argument(s) returned by "func_get_args" might have been modified
    func_get_args();
joelpittet’s picture

Version: 7.x-1.15 » 7.x-1.x-dev

This has been fixed a while ago in the latest stable release. If there is new issues found please file a new issue please.

jweowu’s picture

Definitely new. Neither ctools_access_menu() nor page_manager_search_page() are touched by the original patch/commit.

This pattern is something for the maintainers to keep an eye out for in general. Any time you see either func_get_arg() or func_get_args() in new code, and they're not happening right at the start of the function, the issue should be "Needs work".

joelpittet’s picture

Please file a new issue for these remaining items.

This was committed last year in November, typically we don't reopen old issues, mostly to avoid duplicate and confusing commit messages.

joelpittet’s picture

I've filed that new issue #3046695: Error with PHP7 - "func_get_args" might have been modified and credited @gmario and @loon

robpowell’s picture

jweowu’s picture

As you didn't explain that tag change, I'm changing it back, because "Function argument(s) returned by "func_get_args" might have been modified func_get_args();" is an issue starting from PHP 7.0.