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

Performance: Replace array_key_exists() with isset() check. #53098

Merged
merged 1 commit into from Jul 28, 2023

Conversation

Soean
Copy link
Member

@Soean Soean commented Jul 28, 2023

What?

This was raised as part of #56974, which reviewed several of these checks. isset is slightly preferable over array_key_exists in terms of performance (with the caveat that the two behave differently when it comes to null values).

See: https://core.trac.wordpress.org/ticket/57067

The PHP minimum version was bumped to PHP 7.0 in #52982, so we can update it now.

@Soean Soean added the [Type] Performance Related to performance efforts label Jul 28, 2023
@Soean Soean requested a review from spacedmonkey as a code owner July 28, 2023 08:13
@github-actions
Copy link

This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress.

If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged.

If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack.

Thank you! ❤️

View changed files
❔ lib/class-wp-theme-json-gutenberg.php

@github-actions
Copy link

Flaky tests detected in 9a2b6d3.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5689757482
📝 Reported issues:

@aristath aristath merged commit 27b117b into trunk Jul 28, 2023
52 checks passed
@aristath aristath deleted the array_key_exists branch July 28, 2023 11:14
@github-actions github-actions bot added this to the Gutenberg 16.4 milestone Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Performance Related to performance efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants