Forums

CFV5 Throwing PHP Error in PHP version 7.1

annekm 24 Apr, 2019
Hello,

When updating the PHP version of my server to 7.1, as recommended by Joomla, my ChronoformsV5 is throwing the following error

0 - syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')'

Can you please let me know how to correct this issue? Is ChronoformsV5 compatible with PHP 7.1?

Thanks
Anu
GreyHead 24 Apr, 2019
Hi Anu,

Have you updated to the latest release of CFv5?

Bob
annekm 24 Apr, 2019
Hello,

My CFv5 version is 5.0.17.

I was debugging the php code in my form. The array push in the DB event was throwing the issue.

Changing the Condition parameter in the DB event as below seems to remove the error.

OLD CODE
$where = array(
'mememail' => $form->data['mememail']
);

NEW CODE

$where['mememail'] = $form->data['mememail'];
return $where;
Hope version is 5.0.17 is compatible with PHP 7.1.

Regards,
Anu
GreyHead 24 Apr, 2019
Answer
Hi Anu,

There is a change in the newer PHP versions and iirc you can no longer define an array 'on the fly' instead it has to be declared as an array before it is used.

Bob
annekm 24 Apr, 2019
Hi Bob,

Thanks. The change in the array declaration has rectified the issue.

Now the forms are working fine in PHP 7.1.

Regards,
Anu
This topic is locked and no more replies can be posted.