Title: Another patch: create_function() is deprecated since PHP 7.2
Last modified: December 17, 2019

---

# Another patch: create_function() is deprecated since PHP 7.2

 *  [JochenT](https://wordpress.org/support/users/jochent/)
 * (@jochent)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/another-patch-create_function-is-deprecated-since-php-7-2/)
 * Unfortunately the [patch](https://wordpress.org/support/topic/patch-proposed-create_function-is-deprecated-in-edit-screen-php-php-7-2/)
   provided by ricflomag2 does not work as expected. E.g. the variables `$metabox_id`
   and `$class` are empty when executed in the scope of the anonymous function. 
   A construct like `function() use ($class) { ... $x = $class; ... }` has to be
   used to induce variables from the parent scope.
 * I’ve uploaded a patched version of file [edit-screen.php](https://gist.github.com/jotazzu/25c20fba42e3dc6c40d80439058a8786)
   to Gist. Now the new anonymous functions give the same result as the previous
   create_function() calls.
 * Gist URL: [https://gist.github.com/jotazzu/25c20fba42e3dc6c40d80439058a8786](https://gist.github.com/jotazzu/25c20fba42e3dc6c40d80439058a8786)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [madvic](https://wordpress.org/support/users/madvic/)
 * (@madvic)
 * [6 years ago](https://wordpress.org/support/topic/another-patch-create_function-is-deprecated-since-php-7-2/#post-12872535)
 * Same issue for me.
 *  Plugin Author [Marko Heijnen](https://wordpress.org/support/users/markoheijnen/)
 * (@markoheijnen)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/another-patch-create_function-is-deprecated-since-php-7-2/#post-13500829)
 * Sorry of the delay, will be handled in the next release. Hopefully this weekend.
 *  Plugin Author [Marko Heijnen](https://wordpress.org/support/users/markoheijnen/)
 * (@markoheijnen)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/another-patch-create_function-is-deprecated-since-php-7-2/#post-14112750)
 * Is fixed now

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Another patch: create_function() is deprecated since PHP 7.2’ is closed
to new replies.

 * ![](https://ps.w.org/tabify-edit-screen/assets/icon.svg?rev=1362189)
 * [Tabify Edit Screen](https://wordpress.org/plugins/tabify-edit-screen/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tabify-edit-screen/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tabify-edit-screen/)
 * [Active Topics](https://wordpress.org/support/plugin/tabify-edit-screen/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tabify-edit-screen/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tabify-edit-screen/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Marko Heijnen](https://wordpress.org/support/users/markoheijnen/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/another-patch-create_function-is-deprecated-since-php-7-2/#post-14112750)
 * Status: not a support question