On Fri, Feb 20, 2015 at 10:48 PM, Robert Stoll <p...@tutteli.ch> wrote:

> Hi Dmitry and Anthony,
>
> I was skimming through your conversation about JIT/AOT and that type hints
> would allow to optimise few things.
> I do not know if you are aware of the following but type hints can be
> passed by. Hence neither weak or strict type hints allow to predict the
> type (even if only locally):
>
> function handler($errno, $errstr, $errfile, $errline){
>     return true;
> }
> set_error_handler("handler");
>
> class Foo{}
> function foo(int $x, Foo $f){
>   var_dump($x, $f);
>   $y = $x; //should be int as well, right?
> }
> foo(new Foo(), 1);
>
> Sure, this is something which is hopefully never ever done but anyway, a
> language needs to be able to handle all cases.
>
>
right. I know this of course. and this makes type hints useless.


> As a side notice, if the exceptions in the engine RFC is accepted, then
> this would not be a problem anymore:
> https://wiki.php.net/rfc/engine_exceptions_for_php7
>

"exceptions in the engine" are going to fix this.

Thanks. Dmitry.



>
> Personally, I would expect that the execution is stopped after the
> error_handler was called (after user was able to log etc.)  - at least in
> strict mode.
>
> Cheers,
> Robert
>
>
>

Reply via email to