We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Problem with migration to PHP8.3
In RowEvent.php line 728: [ErrorException] Warning: array_sum(): Addition is not supported on type array
$dateLastErrors in this case is
$dateLastErrors
array ( 'warning_count' => 1, 'warnings' => array ( 12 => 'The parsed date was invalid', ), 'error_count' => 0, 'errors' => array ( ), )
So arrays now cant be summed with arrays
The text was updated successfully, but these errors were encountered:
Patch
diff --git a/src/MySQLReplication/Event/RowEvent/RowEvent.php b/src/MySQLReplication/Event/RowEvent/RowEvent.php index e20c6e9..607b387 100644 --- a/src/MySQLReplication/Event/RowEvent/RowEvent.php +++ b/src/MySQLReplication/Event/RowEvent/RowEvent.php @@ -683,7 +683,7 @@ class RowEvent extends EventCommon $date = DateTime::createFromFormat('YmdHis', $value)->format('Y-m-d H:i:s'); $dateLastErrors = DateTime::getLastErrors(); - if ($dateLastErrors && array_sum($dateLastErrors) > 0) { + if ($dateLastErrors && ($dateLastErrors['warning_count'] + $dateLastErrors['error_count']) > 0) { return null; } @@ -725,7 +725,7 @@ class RowEvent extends EventCommon return null; } $dateLastErrors = DateTime::getLastErrors(); - if ($dateLastErrors && array_sum($dateLastErrors) > 0) { + if ($dateLastErrors && ($dateLastErrors['warning_count'] + $dateLastErrors['error_count']) > 0) { return null; }
Sorry, something went wrong.
No branches or pull requests
Problem with migration to PHP8.3
$dateLastErrors
in this case isSo arrays now cant be summed with arrays
The text was updated successfully, but these errors were encountered: