Re: Bug #69640 Unhandled EngineExceptions thrown from userland do not produce any output
| From: | Xinchen Hui | Date: | Sat, 16 May 2015 15:06:18 +0000 |
| Subject: | Re: Bug #69640 Unhandled EngineExceptions thrown from userland do not produce any output | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-86247@lists.php.net to get a copy of this message | ||
Hey:
On Sat, May 16, 2015 at 1:41 AM, Dan Ackroyd <danack@basereality.com> wrote:
> On 15 May 2015 at 17:12, Xinchen Hui <laruence@gmail.com> wrote:
>>> How would that work when people want to write unit/integration tests
>>> to test the behaviour of a module when an EngineException is thrown?
>>>
>>> If you can't create a certain type of exception, it would mean that
>>> some code is basically untestable...which seems bad.
>> You can not creat it directly, but you can trigger the engine to throw one
>>
>
> I don't think having to do something like:
>
> eval("<?php echo bar(};");
>
> to test ParseExceptions is a good plan.
>
> Can you say what the actual problem is that would be solved by not
> allowing them to be initialized from userland? It seems an artificial
> limitation that just makes it harder to test programs.
EngineException/TypeException/ParserException is designed for internal
errors only.
if then are used in user land. they may cause lots of side affects,
this bug is one of them...
thanks
>
> cheers
> Dan
--
Xinchen Hui
@Laruence
http://www.laruence.com/