php / php/php-src

Generate Notice when error_reporting mode is completely disabled

Open
#9,526 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Category: Engine Feature Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

It's quite common, especially among beginners, to be confused about seemingly ok code not performing anything at all while also not generating any error. The issue may be that either the configuration has set error_reporting to 0 or that their own code contains error_reporting(0). While some might say that there could be valid use cases to have this in a production code, I'd prefer that the language didn't encourage this. For this reason, I think it would be a good idea to generate a Notice whenever error_reporting(0) is used or during PHP startup if INI config contains error_reporting=0. A Notice is generally not considered an error, but rather an informational message. It could reduce some confusion among beginner PHP programmers.

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 tracing the error_reporting(0) handling and the PHP startup path that reads the error_reporting INI setting. Determine how a Notice would be generated in each case and what existing behavior or tests cover these entry points. Done means both explicit error_reporting(0) calls and startup with error_reporting=0 produce the intended Notice.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, php
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.