Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
PHP's create_function() has been deprecated as of PHP 7.2. This function is used to create an anonymous function. PHP 5.3 has an alternative to doing this, this too should be avoided because Drupal 7 officially supports PHP 5.2.5+.
To make this module compatible with future versions of PHP 7, its usage should be replaced with the remaining alternative, which is using a real function definition instead of an anonymous function.
Comment | File | Size | Author |
---|---|---|---|
#5 | deprecated_create_function-2946886-5.patch | 3.59 KB | Deepthi kumari |
| |||
#2 | deprecated_create_function-2946886-2.patch | 875 bytes | Deepthi kumari |
|
Comments
Comment #2
Deepthi kumari CreditAttribution: Deepthi kumari at TA Digital commentedPlease review the patch.
Comment #3
vlklavanya CreditAttribution: vlklavanya as a volunteer and at TA Digital commentedComment #4
generalredneckSo, as the description states... anonymous functions shouldn't be used here. If this was the d8 version that would be different. Consider changing it to the declared real function as mentioned in the description if possible.
Comment #5
Deepthi kumari CreditAttribution: Deepthi kumari at TA Digital commentedHi,
Please review the patch.
Comment #7
generalredneckChanges to admin.inc were committed. the other changes were "coding standards" changes done by an automated tool. Empty Doc blocks were added. Might as well not have any and have the running todo list to add it than add blank ones to appease a tool in my opinion.
Reguardless of the nit picks, Thank you for you contribution!
Comment #9
dks786 CreditAttribution: dks786 commentedHI Deepthi,
Thanks for patch!
Can you please explain the code you added, how its works? because it also dont have function name (2nd line: function(&$val) ).
If we use this following code separately, for test, than it don't work and produce error:
function(&$val) { $val = trim($val);
Can you please explain login behind it, how it works...?
I seen this type of code in other places as well in coding, but couldn't understand that.