WordPress / WordPress/WordPress-Coding-Standards

PHP 8.0 | PHP/NoSilencedErrors: review function list

Open
#1,971 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Focus: Modern PHP Status: Good first issue Status: Help wanted Status: Needs investigation
Dominant language
PHP
Stars
2.8k
Forks
521
Avg merge
5d 20h
Merged PRs (30d)
1

Description

PHP 8 changes the behaviour of the error silence operator @ : where previously it would silence all notices, warnings and errors, it will now only silence notices and warnings, but will not prevent fatal errors/catchable exceptions anymore.

PHP 8 also contains another relevant change, which is that the error level for a number of notices/warnings has been elevated to fatal error/catchable exception.

It would be very helpful if someone would review if any of the functions in the $function_whitelist are affected by these changes and need to be removed from the list.

Note: yes, the name of the property should also be changed, but there's a separate open ticket for that.

This was also discussed in the #core-php Slack channel: https://wordpress.slack.com/archives/C60K3MP2Q/p1611678080004700

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the PHP/NoSilencedErrors implementation and its $function_whitelist. Review each listed function against the PHP 8 error-silencing and error-level changes described in the issue, then update the list where needed and run the relevant project checks to confirm the sniff remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.