php.net |  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
33 - 23 = ?
Subscribe to this entry?

 
 [2011-08-17 13:30 UTC] nicolas dot grekas+php at gmail dot com
Description:
------------
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 (http://bugs.php.net/42098),
- outside/inside output buffering handler, where for eg print_r($v, true) doesn't work (http://bugs.php.net/55428),
- 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?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC