php codesniffer indicates errors in Drupal 7.39 compatibility with php 5.6. Are the errors below a concern?

RUN

phpcs --severity=1 --standard=PHPCompatibility --runtime-set testVersion 5.6 /drupal-7.39

RESULT

modules/filter/filter.api.php error preg_replace() - /e modifier is deprecated in PHP 5.5
modules/filter/filter.api.php error preg_replace() - /e modifier is deprecated in PHP 5.5
includes/bootstrap.inc warning INI directive 'magic_quotes_runtime' is deprecated from PHP 5.3 and forbidden from PHP 5.4.
includes/common.inc warning INI directive 'magic_quotes_gpc' is deprecated from PHP 5.3 and forbidden from PHP 5.4.
includes/common.inc error preg_replace() - /e modifier is deprecated in PHP 5.5
includes/unicode.inc warning INI directive 'mbstring.http_input' is deprecated from PHP 5.6.
includes/unicode.inc warning INI directive 'mbstring.http_output' is deprecated from PHP 5.6.
includes/language.inc error 'clone' is a reserved keyword introduced in PHP version 5.0 and cannot be invoked as a function (T_CLONE)
includes/database/select.inc error 'clone' is a reserved keyword introduced in PHP version 5.0 and cannot be invoked as a function (T_CLONE)
includes/database/select.inc error 'clone' is a reserved keyword introduced in PHP version 5.0 and cannot be invoked as a function (T_CLONE)
includes/database/select.inc error 'clone' is a reserved keyword introduced in PHP version 5.0 and cannot be invoked as a function (T_CLONE)
includes/database/select.inc error 'clone' is a reserved keyword introduced in PHP version 5.0 and cannot be invoked as a function (T_CLONE)
includes/database/select.inc error 'clone' is a reserved keyword introduced in PHP version 5.0 and cannot be invoked as a function (T_CLONE)
includes/database/query.inc error 'clone' is a reserved keyword introduced in PHP version 5.0 and cannot be invoked as a function (T_CLONE)
includes/database/query.inc error 'clone' is a reserved keyword introduced in PHP version 5.0 and cannot be invoked as a function (T_CLONE)

Comments

webservant316 created an issue. See original summary.

webservant316’s picture

Many are certainly using Drupal 7 with PHP 5.6 so it would seem that these errors listed by PHP CodeSniffer are of no concern. However, I am just checking before making the switch. Also in my installation PHP CodeSniffer exposed that several of the contributed modules I am using had the same " 'clone' is a reserved keyword " error.

webservant316’s picture

Title: phpcs php codesniffer produces errors on phpcompatibility test for php56 5.6 » phpcs php codesniffer produces errors on compatibility test for php 56 5.6
webservant316’s picture

I have successfully moved to php56 with Drupal 7.40 and over 100 modules. Everything seems fine. No PHP errors. No Drupal error logs. The only observed problem is the PHP Code Sniffer compatibility errors listed above.

Any feedback on the importance of the errors above would be appreciated.

chrisgross’s picture

Version: 7.39 » 7.54
Parent issue: » #2656548: Fully support PHP 7.0 in Drupal 7

Updating for 7.54 and adding parent issue.

MustangGB’s picture

mfb’s picture

I ran it and many of these no longer appear, and almost everything is due to compatibility with older versions - PHP 5.6 support isn't broken at all - or an issue in filter.api.php sample code.

The only noteworthy finding, which seems worth filing a bug report for, was: includes/database/prefetch.inc
------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------------
288 | ERROR | The "element to prepend" parameter for function array_unshift() is missing, but was required for PHP version 7.2 and lower
------------------------------------------------------------------------------------------------------------------------------------------

mfb’s picture

Status: Active » Fixed
Parent issue: #3012308: D7: Fully support PHP 7.3 »

The array_unshift() bug has already been reported at #1476782: DatabaseStatementPrefetch::current PHP function array_unshift() are used incorrectly and various duplicates.

Removing PHP 7.3 parent because this is no longer a bug in 7.3

Status: Fixed » Closed (fixed)

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