Re: [VOTE] Allowing use of exceptions in the engine

From: Date: Tue, 10 Dec 2013 18:42:41 +0000
Subject: Re: [VOTE] Allowing use of exceptions in the engine
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-70574@lists.php.net to get a copy of this message
Hi! > If an application fatal'd, then I don't really care if my data structures > are invalid: I just want to save what I can save and quit. If I want to The part that you're missing here is that it's not your data structures that may be invalid, it's engine's. And what you call "I can save and quit", the engine calls "execute arbitrary amount of code", for which it needs valid data structures. Unless your "save and quit" code does not call any functions and does nothing useful at all, from the engine POV your "save and quit" is no different from "continue working normally" - it needs all the data structures to be in a perfect order as if nothing bad happened. For some errors, it may be possible. For some, it may be possible but hard. For some, it may not be possible. But the main point here is this: For the engine, there's no difference between "continue normally as nothing happened" and "save and quit", as soon as you start running PHP code that does anything useful at all. So if you can recover from an error, you can recover to a normal state. If you can not, then you can not. There's no "save and quit" scenario here that can do anything different. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#70574) next »