Giter Site home page Giter Site logo

Comments (5)

Girgias avatar Girgias commented on May 29, 2024

@haszi do you maybe have an idea about this?

from php-src.

haszi avatar haszi commented on May 29, 2024

No idea as this doesn't seem to be output buffering related. If I understand the above correctly what is being asked here is whether zend_get_executed_filename() can retrieve the current filename during shutdown but as is also mentioned, EG(current_execute_data) is set to NULL. This is the source code and the comment that goes with it:

php-src/main/main.c

Lines 1829 to 1832 in bb6e611

/* EG(current_execute_data) points into nirvana and therefore cannot be safely accessed
* inside zend_executor callback functions.
*/
EG(current_execute_data) = NULL;

from php-src.

aswingit avatar aswingit commented on May 29, 2024

Thank you. When the shutdown phase occurs and the output handler (in this case, 'system') is executed, it triggers zend_call_function. The issue arises because the current execution context is set to NULL, resulting in the absence of the previous execution context when the system or output handler callback command is executed.

zend_get_executed_filename navigates through the context stack to locate the type of user-defined function in order to retrieve the filename. Without previous context, it's not able to derive filename.

from php-src.

haszi avatar haszi commented on May 29, 2024

The description of your issue and your question under Expected behavior seem like two different issue to me, but to comment on the first, passing system() to ob_start() will result in a warning as the second argument ob_start() passes to system() is not passed by reference so results in this warning:

PHP Warning: system(): Argument #2 ($result_code) must be passed by reference

I cannot comment on your question other than that the comment in the source code suggests that that is currently not possible.

from php-src.

aswingit avatar aswingit commented on May 29, 2024

The problem isn't with the 'system' function, but with 'ob_flush'. Let's say I use a custom function from my extension that tries to read zend_get_executed_filename(). It doesn't get the right context when flush occurs during the shutdown phase.

from php-src.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.