Re: [RFC] Exceptions in the engine

From: Date: Thu, 19 Feb 2015 09:12:05 +0000
Subject: Re: [RFC] Exceptions in the engine
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-83161@lists.php.net to get a copy of this message
"Nikita Nefedov" wrote in message news:CALuY8tjUq70eLkV-MbDi-fEXZvWTFi82zCNmWr7tmvpiES9=Pw@mail.gmail.com...
On 18 Feb 2015 13:53, "Tony Marston" <TonyMarston@hotmail.com> wrote:
Could it be restricted to the current scope? In your example the call to
fopen() exists in the load_data() function and is not in a try ... catch block within *that* function, so the fact that the call to load_data() is within a try ... catch block should be irrelevant as it is in a different scope. Hi Tony, This sounds very hacky.
You could say that every piece of code is a "hack" with the only difference being that some hacks are ugly while others are beautiful.
If you want exceptions with file/stream functions I suggest you to find some open library out there that can handle your user case or you can use SplFileObject.
-- Tony Marston

« previous php.internals (#83161) next »