Skip to content

PHP/NoSilencedErrors: remove tolerance for parse_url()#2701

Merged
GaryJones merged 1 commit into
developfrom
feature/nosilencederrors-remove-exception-parse-url
Feb 24, 2026
Merged

PHP/NoSilencedErrors: remove tolerance for parse_url()#2701
GaryJones merged 1 commit into
developfrom
feature/nosilencederrors-remove-exception-parse-url

Conversation

@jrfnl
Copy link
Copy Markdown
Member

@jrfnl jrfnl commented Feb 23, 2026

Description

The parse_url() function was in the list of functions allowed to use error silencing due to it throwing an E_WARNING in certain circumstances in PHP < 5.3.3.

I believe by now, we should no longer need to take PHP < 5.3.3 into account, so this exception should no longer be permitted.

Suggested changelog entry

WordPress.PHP.NoSilencedErrors: error silencing is no longer accepted for the parse_url() function.

The `parse_url()` function was in the list of functions allowed to use error silencing due to it throwing an `E_WARNING` in certain circumstances in PHP < 5.3.3.

I believe by now, we should no longer need to take PHP < 5.3.3 into account, so this exception should no longer be permitted.
@jrfnl jrfnl added this to the 3.3.x milestone Feb 23, 2026
@jrfnl jrfnl changed the title NoSilencedErrors: remove tolerance for parse_url() PHP/NoSilencedErrors: remove tolerance for parse_url() Feb 23, 2026
Copy link
Copy Markdown
Contributor

@rodrigoprimo rodrigoprimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! For reference, the PHP bug report confirming the E_WARNING was removed in PHP 5.3.3: https://bugs.php.net/bug.php?id=50563. And here is a 3v4l.org snippet showing the warning on PHP < 5.3.3, and no warning on any currently supported PHP version: https://3v4l.org/04lvl

@jrfnl
Copy link
Copy Markdown
Member Author

jrfnl commented Feb 23, 2026

LGTM! For reference, the PHP bug report confirming the E_WARNING was removed in PHP 5.3.3: https://bugs.php.net/bug.php?id=50563. And here is a 3v4l.org snippet showing the warning on PHP < 5.3.3, and no warning on any currently supported PHP version: https://3v4l.org/04lvl

Indeed. It used to also be in the docs, but references to PHP 5 were removed from the docs a couple of years ago.
You can still see the old docs here though: https://php-legacy-docs.zend.com/manual/php5/en/function.parse-url#refsect1-function.parse-url-changelog

@GaryJones GaryJones merged commit ea73437 into develop Feb 24, 2026
42 checks passed
@GaryJones GaryJones deleted the feature/nosilencederrors-remove-exception-parse-url branch February 24, 2026 16:08
@jrfnl jrfnl modified the milestones: 3.3.x, 3.4.0 Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants