php / php/php-src

Generate Notice when error_reporting mode is completely disabled

Offen
#9,526 10 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Category: Engine Feature Status: Needs Triage
Vorherrschende Sprache
C
Sterne
40.4k
Forks
8.1k
Ø Merge
2 T. 13 Std.
Gemergte PRs (30 T.)
96

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Behandlung von error_reporting(0) und den PHP-Startup-Pfad nachzuverfolgen, der die INI-Einstellung error_reporting liest. Ermittle, wie in jedem Fall ein Notice erzeugt würde und welches bestehende Verhalten oder welche Tests diese Einstiegspunkte abdecken. Als erledigt gilt die Aufgabe, wenn sowohl explizite Aufrufe von error_reporting(0) als auch der Startup mit error_reporting=0 das vorgesehene Notice erzeugen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c, php
Bereich
backend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.