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
Comment #2
webservant316 CreditAttribution: webservant316 commentedMany 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.
Comment #3
webservant316 CreditAttribution: webservant316 commentedComment #4
webservant316 CreditAttribution: webservant316 commentedI 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.
Comment #5
chrisgross CreditAttribution: chrisgross commentedUpdating for 7.54 and adding parent issue.
Comment #6
MustangGB CreditAttribution: MustangGB commentedComment #7
mfbI 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
------------------------------------------------------------------------------------------------------------------------------------------
Comment #8
mfbThe 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