Issue with ob handler context and execution in PHP
Personne n'a encore pris cette issue.
- Langage dominant
- C
- Étoiles
- 40.4k
- Forks
- 8.1k
- Merge moyen
- 2 j 13 h
- PR mergées (30 j)
- 96
Description
Description
I am encountering an issue while working with the "ob_start" function in PHP and the callback parameter.
Description:
When utilizing ob_start("system") to initiate output buffering with the "system" callback in the provided code snippet, I've observed that the zend_get_executed_filename function fails to return the correct file name when the "system" zend function is executed.
This discrepancy occurs particularly when a flush operation happens during php_request_shutdown.
<?php
ob_start("system");
?>
Observations:
Upon debugging, I've noticed the following:
- Omission of the ob_flush() function call results in the flushing of output handlers during php_request_shutdown.
- Prior to the invocation of php_output_end_all, the EG(current_execute_data) variable is set to NULL.
- Consequently, when the "system" function is executed, it operates without the context of the current executed file name, leading to unexpected behavior.
Expected Behavior:
I expect the zend_get_executed_filename function to accurately retrieve the file name, even in scenarios involving flush operations during php_request_shutdown. Is this feasible?
PHP Version
PHP 8.3.3
Operating System
No response
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par suivre php_request_shutdown à travers php_output_end_all lorsque ob_start("system") est utilisé, et examinez comment EG(current_execute_data) est géré avant que system appelle zend_get_executed_filename. Reproduisez l’exemple de PHP 8.3.3 avec et sans ob_flush(); done signifie que le nom de fichier exécuté reste correct pendant le vidage lors du shutdown.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- c, php
- Domaine
- backend
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100