• Please consider to use callbacks instead of create_function.

    Deprecated: Function create_function() is deprecated in /srv/www/ccv/public_html/wp-content/plugins/cms-tree-page-view/functions.php on line

    By the documentation

    Caution

    This function internally performs an eval() and as such has the same security issues as eval(). Additionally it has bad performance and memory usage characteristics.

    If you are using PHP 5.3.0 or newer a native anonymous function should be used instead.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I was coming here to report this. We’re currently running tests of plugins with PHP Compatibility Checker. It generates the following warning for CMS Tree Page View when tested on PHP 7.2:

    FILE: [path redacted]/wp-content/plugins/cms-tree-page-view/functions.php
    ———————————————————————–
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ———————————————————————–
    654 | WARNING | Function create_function() is deprecated since PHP 7.2; Use an anonymous function instead
    ———————————————————————–

    Replacing the create_function usage with an anonymous function (i.e. a closure) seems like an easy solution, however anonymous function usage would push the minimum PHP version requirement to at least 5.3. Speaking for my own use this would be fine, however as this plugin is widely used this update is not as simple as it seems.

    • This reply was modified 6 years, 11 months ago by Grant Palin.
    • This reply was modified 6 years, 11 months ago by Grant Palin.

    The developer could easily check for php version and keep create_function if <5.3 to maintain backwards compatibility.
    5.2 has been EOL for about 8 years now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Deprecated function `create_function`’ is closed to new replies.