Title: PHP 7.2 Issue with create_function
Last modified: January 10, 2019

---

# PHP 7.2 Issue with create_function

 *  Resolved [Matt](https://wordpress.org/support/users/syntax53/)
 * (@syntax53)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/php-7-2-issue-with-create_function/)
 * PHP Deprecated: Function create_function() is deprecated in broken-link-checker\
   modules\checkers\http.php on line 147

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

 *  [moody1337](https://wordpress.org/support/users/moody1337/)
 * (@moody1337)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/php-7-2-issue-with-create_function/#post-11084072)
 * Just change the whole function to:
 *     ```
       function urlencodefix($url){
       	//TODO: Remove/fix this. Probably not a good idea to "fix" invalid URLs like that.
       	return preg_replace_callback(
       		'|[^a-z0-9\+\-\/\\#:.,;=?!&%@()$\|*~_]|i',
       		function ($str) {
       			return rawurlencode($str[0]);
       		},
       		$url);
       }
       ```
   
 *  [hongpong](https://wordpress.org/support/users/hongpong/)
 * (@hongpong)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/php-7-2-issue-with-create_function/#post-11305011)
 * Good catch [@syntax53](https://wordpress.org/support/users/syntax53/) & [@moody1337](https://wordpress.org/support/users/moody1337/).
   Here is the current situation:
 * I have put together all the patches around on Github I could find via the network
   analysis, including PHP7 fixes and transaction fixes (a lot of this was gathered
   by other developers, see the last link on the post for info). The plugin has 
   not been maintained by what is now a unit of GoDaddy since about Q3 2017.
 * The Head of the patched Broken Link Checker github repo can be downloaded here
   if you want to try it:
    [https://github.com/HongPong/broken-link-checker/archive/master.zip](https://github.com/HongPong/broken-link-checker/archive/master.zip)
   Repo URL: [https://github.com/HongPong/broken-link-checker](https://github.com/HongPong/broken-link-checker)
 * Please take a look at the issues I wrote up which illustrates good ideas that
   can be applied to this plugin:
    [https://github.com/HongPong/broken-link-checker/issues](https://github.com/HongPong/broken-link-checker/issues)
 * Note this repo URL is subject to change – if i have to fork it i will change 
   the URL. I already have a “cool name” in mind.
 * I have requested to take over managing this plugin:
    [https://wordpress.org/support/topic/request-to-transfer-ownership-of-broken-link-checker/](https://wordpress.org/support/topic/request-to-transfer-ownership-of-broken-link-checker/)
   If you support this, you can chime in there! Thanks for the vigilance 🙂
 *  [Nemanja Aleksić](https://wordpress.org/support/users/kouteki/)
 * (@kouteki)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/php-7-2-issue-with-create_function/#post-11338188)
 * Hi [@syntax53](https://wordpress.org/support/users/syntax53/)
 * We’ve just updated the Broken Link Checker plugin to the latest version. Could
   you test it and let us know if it works out the box, without having to replace
   the function [@moody1337](https://wordpress.org/support/users/moody1337/) posted?
 * Thanks!
    Nemanja
 *  [mumbomedia](https://wordpress.org/support/users/mumbomedia/)
 * (@mumbomedia)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/php-7-2-issue-with-create_function/#post-11478075)
 * [@kouteki](https://wordpress.org/support/users/kouteki/)
 * By latest version do you mean 1.11.8?
    If so I’m sorry to say that the messages
   [@syntax53](https://wordpress.org/support/users/syntax53/) posted are still present.
 * Without the changes [@moody1337](https://wordpress.org/support/users/moody1337/)
   posted there is no chance that this messages will not being thrown. Take a look
   at [https://www.php.net/manual/en/function.create-function.php](https://www.php.net/manual/en/function.create-function.php).
   What could this being misunderstood: “Warning This function has been DEPRECATED
   as of PHP 7.2.0. Relying on this function is highly discouraged.”?
 * Also the code [@moody1337](https://wordpress.org/support/users/moody1337/) is
   the same as before but now it is using the native anonymous function which is
   recommended [@see](https://wordpress.org/support/users/see/) [https://www.php.net/manual/en/functions.anonymous.php](https://www.php.net/manual/en/functions.anonymous.php).
 * So I would recommend to eliminate all create_function calls within your plugin
   code base and replace them by native anymous function because WordPress will 
   only run without any notices with PHP > 5.5 and not every user of you plugin 
   has the oppprtunity to adjust the php version. In most cases the server works
   with the latest stable release of php and therefore compatibility with PHP 7 
   should be mandantory.
    -  This reply was modified 7 years, 1 month ago by [mumbomedia](https://wordpress.org/support/users/mumbomedia/).
    -  This reply was modified 7 years, 1 month ago by [mumbomedia](https://wordpress.org/support/users/mumbomedia/).

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

The topic ‘PHP 7.2 Issue with create_function’ is closed to new replies.

 * ![](https://ps.w.org/broken-link-checker/assets/icon-256x256.png?rev=2900468)
 * [Broken Link Checker](https://wordpress.org/plugins/broken-link-checker/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/broken-link-checker/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/broken-link-checker/)
 * [Active Topics](https://wordpress.org/support/plugin/broken-link-checker/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/broken-link-checker/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/broken-link-checker/reviews/)

 * 4 replies
 * 5 participants
 * Last reply from: [mumbomedia](https://wordpress.org/support/users/mumbomedia/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/php-7-2-issue-with-create_function/#post-11478075)
 * Status: resolved