Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create_function() is deprecated in PHP 7.2 #921

Open
raamdev opened this issue Dec 19, 2017 · 2 comments
Open

create_function() is deprecated in PHP 7.2 #921

raamdev opened this issue Dec 19, 2017 · 2 comments

Comments

@raamdev
Copy link
Contributor

raamdev commented Dec 19, 2017

Seen with WP4.9.1 running on a PHP7.2.0 server:
PHP Deprecated: Function create_function() is deprecated in …\wp-content\plugins\comet-cache\src\includes\traits\Shared\FsUtils.php on line 33

Reported here: https://wordpress.org/support/topic/version-170220-function-create_function-is-deprecated-in-php-7-2/

@raamdev raamdev added this to the Future Release milestone Dec 19, 2017
@jaswrks
Copy link

jaswrks commented Feb 8, 2018

Looks like all of these could now be updated. We can use Closures instead of create_function() now that we have a 5.3 minimum. http://php.net/manual/en/migration53.new-features.php

raamdev added a commit to wpsharks/comet-cache-pro that referenced this issue Feb 25, 2018
create_function() has been deprecated as of PHP 7.2

See wpsharks/comet-cache#921
@raamdev raamdev modified the milestones: Future Release, Next Release Feb 25, 2018
@raamdev
Copy link
Contributor Author

raamdev commented Feb 25, 2018

It looks like we actually don't want to use Closures in plugin.php, since the code in that file where we use create_function() is code designed to show error notices for users running PHP < v5.4, which means using Closures there would actually break that code and not do what it's supposed to do (show a message when a user tries to run Comet Cache with PHP < 5.4).

raamdev added a commit to wpsharks/comet-cache-pro that referenced this issue Feb 25, 2018
create_function() has been deprecated as of PHP 7.2

Occurrences of create_function() in /plugin.php were intentionally
excluded from this update as that source code is run when PHP < 5.4 is
detected (Closures require PHP 5.4+).

See wpsharks/comet-cache#921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants