call_user_func special function optimization unsound with strict_types
Aperta
Nessuno ha ancora preso questa issue.
Bug
Category: Engine
Status: Needs Triage
- Lingua principale
- C
- Stelle
- 40.4k
- Fork
- 8.1k
- Merge medio
- 2g 13h
- PR unite (30g)
- 96
Descrizione
Description
The following code:
<?php
declare(strict_types=1);
namespace Foo;
// strlen() will be called with strict_types=0, so this is legal.
var_dump(call_user_func('strlen', false));
// Called with strict_types=1
var_dump(\call_user_func('strlen', false));
Resulted in this output:
int(0)
Fatal error: Uncaught TypeError: strlen(): Argument #1 ($string) must be of type string, false given in /in/bcCZ4:10
Stack trace:
#0 /in/bcCZ4(10): strlen(false)
#1 {main}
thrown in /in/bcCZ4 on line 10
But I expected this output instead:
Well, not sure, it should be consistent I suppose
PHP Version
8.3+
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
Inizia con il reproducer fornito per PHP 8.3+ e confronta i percorsi di chiamata namespaced e fully qualified di call_user_func con strict_types=1. Traccia l’ottimizzazione delle funzioni speciali nell’interprete PHP, quindi rendi coerente il comportamento e aggiungi la copertura per entrambe le chiamate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- c, php
- Ambito
- backend, compilers
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100