I found some occurrences of code affected by the uniform variable syntax changes for PHP 7:
Searching files for ->\$\w*?\[ (regex)
linkchecker.module (line 1551)
$field = field_info_field($field_name);
// #1923328: field_name array may be missing in $entity.
$entity_field = isset($entity->$field['field_name']) ? $entity->$field['field_name'] : array();
linkchecker.module (line 1618)
foreach (field_info_instances($entity_type, $bundle_name) as $field_name => $instance) {
$field = field_info_field($field_name);
$entity_field =& $entity->$field['field_name'];
Each section uses $entity->$field['field_name'], which in PHP 5 means $entity->{$field['field_name']}, but in PHP 7 means ($entity->$field)['field_name']. So if the module supports both, the code should probably be made explicit so that it is consistent across versions. I don't know which interpretation is correct.
Comments
Comment #2
solideogloria commentedComment #3
c-logemannOnly for the priority: Is this currently an error or a warning on PHP 7 and on which subversions of PHP 7.
Comment #4
solideogloria commentedI don't know if there are errors. The syntax changed between versions and I found this ambiguity via a code scan.
Comment #5
euk commentedUPD: This seems to be fixed in 7.x-1.4, while I was referring to 7x.1.2
I was observing these:
Notice: Array to string conversion in _linkchecker_parse_fields() (line 1551 of /var/www/html/dev/doi_dev.opengov.ibmcloud.com/current/modules/contrib/linkchecker/linkchecker.module).It also seems to have a side effect of returning NULL on line 1195 - not always, but occasionally, I see a warning that argument #2 of array_merge is not an array:
Comment #6
solideogloria commented@euk, I don't think that's related to this issue.
Comment #7
quadrexdevD7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.
If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.
Thanks!