Buy Now
Sign in

PHP 7.2 Error

jwill , October 10 2019, 16:33
jwill 48
October 10 2019, 16:33 #389490
I have several long complex forms on a site that almost never has changes. Because the forms work, I have never wanted to spend the time to rebuild all of the forms. After updating to PHP 7.2, I am receiving the following warning:
"Deprecated: Function create_function() is deprecated in /home/metro103/public_html/components/com_chronoforms/libraries/chronoform.php on line 410"
Is there an easy fix for this that will keep me from having to rebuild all of the forms?
GreyHead 64
October 10 2019, 17:50 #389493
Hi Jim,
Please see this post.
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
jwill 48
October 10 2019, 18:53 #389494
So would the bold part of this line

function _camilize($class = ''){
return preg_replace_callback('/(?:^|_)(.?)/i',create_function('$matches', 'return strtoupper($matches[1]);'), $class);
Be changed to this
function('$matches'){return strtoupper ($matches[1];},
healyhatman 9
October 11 2019, 03:32 #389495
function('$matches'){return strtoupper ($matches[1]);},
but yes, something like that.
Web developer at - I DO NOT work for ChronoEngine!
Professional Work:
Custom CF / CC Plugins and Extensions:
jwill 48
October 12 2019, 02:37 #389507
dtsilog 6
August 04 2020, 17:36 #393533
Thank you Bob and all, i had the same error in my Joomla site:
"Deprecated: Function create_function() is deprecated in *****/components/com_chronoforms/libraries/chronoform.php on line 410".
In chronoform.php file and line 410 i replaced ONLY below code:
create_function('$matches', 'return strtoupper($matches[1]);')
with this:
function($matches){return strtoupper($matches[1]);}
and it worked, error message dissapeard!! The only difference is that function('$matches') needs to be function($matches) - without ' '.
Tested on PHP 7.2 and 7.3, i still use Chronoforms 4.0.8 and latest joomla 3.9.20.
Thank you again!