Skip to content

PHP 7.4 warning #1389

@jonathanstegall

Description

@jonathanstegall

Describe the bug

When running a PHPCS compatibility check for PHP 7.4, the only thing CMB2 seems to report is this, in the file /cmb2/includes/CMB2_Base.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 "$message" was used, and possibly changed (by reference), on line 416.

Steps to reproduce (I have confirmed I can reproduce this issue on the develop branch):

  1. Set up PHPCompatibilityWP
  2. In the root of WordPress where composer.json is, run the command ./vendor/bin/phpcs -p . --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion 7.3-

Possible Solution

Possibly, the solution is to move $args = func_get_args(); before the if ( is_numeric( $message ) ) { call.

Possible Solution's Risk Level

Screenshots

If applicable, add screenshots to help explain your problem.

Your Environment

Browser name and version:
Operating System and version (desktop or mobile): macOS Catalina.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions