Inconsistent use of E_WARNING and E_COMPILE_WARNING in zend_compile.c
Aperta
Nessuno ha ancora preso questa issue.
Bug
Status: Needs Triage
- Lingua principale
- C
- Stelle
- 40.4k
- Fork
- 8.2k
- Merge medio
- 2g 13h
- PR unite (30g)
- 96
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci i due esempi di avviso usando test7.php, quindi esamina i percorsi di emissione degli avvisi in zend_compile.c. Confronta come vengono segnalati l'avviso per l'uso non composto e l'avviso sul tipo integer, e verifica che gli avvisi di compilazione utilizzino in modo coerente il comportamento previsto del gestore degli errori.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- c, php
- Ambito
- compilers
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100