Skip to content
New issue

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

#4938: Workaround for PHP 8.2.0 segmentation fault / assertion error #4939

Merged
merged 1 commit into from Jan 3, 2023

Conversation

Deltik
Copy link
Member

@Deltik Deltik commented Jan 2, 2023

Fixes: #4938

Motivation and Context

e107 won't run on PHP 8.2.0 due to this bug: #4938 » php/php-src#10200

Description

Casting a SimpleXMLElement to an array should be equivalent to get_object_vars(…) as far as I can tell. At least all existing tests pass and I don't see any visual regressions upon making this change.

By replacing get_object_vars(…) with a cast to array, we sidestep this PHP 8.2.0 bug: php/php-src#10200

How Has This Been Tested?

Existing tests pass, and I don't see anything amiss when clicking around e107 with this patch.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (a change to man pages or other documentation)

Checklist

… error

Casting a `SimpleXMLElement` to an array should be equivalent to
`get_object_vars(…)` as far as I can tell.  At least all existing
tests pass and I don't see any visual regressions upon making this
change.

By replacing `get_object_vars(…)` with a cast to array, we sidestep
this PHP 8.2.0 bug: php/php-src#10200

Fixes: e107inc#4938
@Deltik Deltik requested a review from CaMer0n January 2, 2023 13:26
@codeclimate
Copy link

codeclimate bot commented Jan 3, 2023

Code Climate has analyzed commit 377da20 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (80% is the threshold).

This pull request will bring the total coverage in the repository to 34.4% (-0.3% change).

View more on Code Climate.

@CaMer0n
Copy link
Member

CaMer0n commented Jan 3, 2023

Thank you! 👍 🥇

@CaMer0n CaMer0n merged commit 3bdb545 into e107inc:master Jan 3, 2023
@Deltik Deltik deleted the fix/4938 branch January 3, 2023 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Low-level PHP 8.2.0 crash
2 participants