I am working with Laravel 5.6 and using Braintree payment gateway sand box. but when I update my php version it is encounters some error. like this
Function create_function() is deprecated
in Util.php line 206
at HandleExceptions->handleError(8192, 'Function create_function() is deprecated', 'C:\\Users\\mala\\Desktop\\ddddd\\vendor\\braintree\\braintree_php\\lib\\Braintree\\Util.php', 206, array('string' => 'client_token', 'delimiter' => '-', 'callbacks' => array()))in Util.php line 206
so, I am using braintree vertion, ``` "oureastudios/laravel5-braintree": "dev-master" `` but when I search in internet most people suggested update braintree dependancy to v3.26.0. then My problem is how can I update My current braintree to above new vertion?
create_function is deprecated in PHP 7.2
in the file /Braintree/Util.php the function delimiterToCamelCase
Use:
$callback = function ($matches) {
return strtoupper($matches[1]);
};
instead of:
$callback = create_function('$matches', 'return strtoupper($matches[1]);');
Link Reference: https://github.com/braintree/braintree_php/commit/37e54736ef949cc022a3f87a9fed53820b798c3e