Inconsistent use of E_WARNING and E_COMPILE_WARNING in zend_compile.c
Offen
Dieses Issue hat noch niemand übernommen.
Bug
Status: Needs Triage
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.1k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
Description
The following code:
<?php
set_error_handler(function (int $errno, string $errstr) {
var_dump($errno, $errstr);
}, E_ALL);
include('test7.php');
and
<?php
use Foo;
function foo(integer $foo) {
}
Resulted in this output:
int(2)
string(60) "The use statement with non-compound name 'Foo' has no effect"
Warning: "integer" will be interpreted as a class name. Did you mean "int"? Write "\integer" to suppress this warning in php-src/test7.php on line 5
But I expected this output instead:
Warning: The use statement with non-compound name 'Foo' has no effect in php-src/test7.php on line 3
Warning: "integer" will be interpreted as a class name. Did you mean "int"? Write "\integer" to suppress this warning in php-src/test7.php on line 5
or
int(2)
string(60) "The use statement with non-compound name 'Foo' has no effect"
int(2)
string(108) ""integer" will be interpreted as a class name. Did you mean "int"? Write "\integer" to suppress this warning"
The same applies to other warnings emitted during compilation.
PHP Version
git master
Operating System
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere die beiden Warnungsbeispiele mit test7.php und untersuche anschließend die Pfade zur Ausgabe von Warnungen in zend_compile.c. Vergleiche, wie die Warnung zur nicht zusammengesetzten Verwendung und die Warnung zum Integer-Typ gemeldet werden, und verifiziere, dass Kompilierungswarnungen konsistent das vorgesehene Verhalten des Fehlerhandlers verwenden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, php
- Bereich
- compilers
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100