tombenner / wp-mvc

An MVC framework for WordPress
http://wpmvc.org
MIT License
623 stars 172 forks source link

Use anonymous functions instead of create_function() #225

Closed patrik-csak closed 6 years ago

patrik-csak commented 6 years ago

create_function() is deprecated in PHP v7.2.0

cyberscribe commented 6 years ago

Thanks for this! Please could you convert the square bracket definitions back to array() declarations? Anonymous functions are supported for php 5.3+ but square brackets don't come in until 5.4+. In theory WordPress plugins ought to work back to 5.2.4 (I know, crazy--but a lot of site still run really old versions of php). In the case where 5.2.4 compatibility breaks 7.x functionality (i.e. anonymous versus create_function functions) I'm siding with 7.x of course. But if we can keep it back-compat. without extra hassle, let's do it.

Looking forward to the revised pull req. Thanks again!

patrik-csak commented 6 years ago

Fixed! I realized that I introduced a some usages of the short array syntax in previous commits, so I've opened a PR to fix those as well.

cyberscribe commented 6 years ago

Awesome, thanks!