|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #55440 Internal state of the execution engine
Submitted: 2011-08-17 13:30 UTC Modified: 2012-01-28 21:02 UTC
From: nicolas dot grekas+php at gmail dot com Assigned:
Status: Closed Package: *General Issues
PHP Version: 5.3.6 OS:
Private report: No CVE-ID: None
 [2011-08-17 13:30 UTC] nicolas dot grekas+php at gmail dot com
While developing in PHP, I've learned that the execution engine is sometimes set in special states that alter its capabilities.

As far as I know, their is no way for us developers to write code that test for one of these particular state and branch code appropriately.

By "special state", I mean :
- execute/compile stage, where for eg autoloading doesn't work (,
- outside/inside output buffering handler, where for eg print_r($v, true) doesn't work (,
- before/after "shutdown time", where for eg uncatched exceptions generate the cryptic "Fatal error: Exception thrown without a stack frame in Unknown on line 0" and set_exception_handler() is disabled.

Adding a centralized way to check for these states is maybe a good idea ?
For example, get_engine_state( void ) would return a bit field, each bit for each possible state?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-01-28 21:02 UTC] nicolas dot grekas+php at gmail dot com
Rethinking about it, this is a bad idea, because it would expose this internal behavior to userland.

It would be a lot better to remove these specials cases: they are not mandatory, only an artifact of the current implementation of the engine.

So if that happen on day, the function would have to be removed, causing potential BC break.
 [2012-01-28 21:02 UTC] nicolas dot grekas+php at gmail dot com
-Status: Open +Status: Closed
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Apr 04 08:01:23 2020 UTC