Title: Deprecated function `create_function`
Last modified: March 23, 2018

---

# Deprecated function `create_function`

 *  [Guido Scialfa](https://wordpress.org/support/users/wido/)
 * (@wido)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/deprecated-function-create_function-4/)
 * 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)

 *  [model13](https://wordpress.org/support/users/model13/)
 * (@model13)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/deprecated-function-create_function-4/#post-10146095)
 * 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 ———————————————————————–
 *  [Grant Palin](https://wordpress.org/support/users/grantpalin/)
 * (@grantpalin)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/deprecated-function-create_function-4/#post-10152493)
 * 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 8 years, 1 month ago by [Grant Palin](https://wordpress.org/support/users/grantpalin/).
    -  This reply was modified 8 years, 1 month ago by [Grant Palin](https://wordpress.org/support/users/grantpalin/).
 *  [eric3d](https://wordpress.org/support/users/eric3d/)
 * (@eric3d)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/deprecated-function-create_function-4/#post-10730504)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/cms-tree-page-view_f1f1f1.svg)
 * [CMS Tree Page View](https://wordpress.org/plugins/cms-tree-page-view/)
 * [Support Threads](https://wordpress.org/support/plugin/cms-tree-page-view/)
 * [Active Topics](https://wordpress.org/support/plugin/cms-tree-page-view/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cms-tree-page-view/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cms-tree-page-view/reviews/)

 * 3 replies
 * 4 participants
 * Last reply from: [eric3d](https://wordpress.org/support/users/eric3d/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/deprecated-function-create_function-4/#post-10730504)
 * Status: not a support question