On 12/05/16 13:38, Rowan Collins wrote:
> Now let's say the author of the something function decides to use the
> new nullable type hint:
> 
> function something(?Bar $bar) {}
> something(new Bar); // OK
> something(); // Error: Missing required parameter
> something(null); // OK
> 
> None of your code will be calling something(null) yet, because it was
> previously an error. So you now have an *extra* way of calling the
> function, but you don't need to change any existing usages.

I'm sorry to be dragging this out, but some of this stuff IS getting
more and more difficult to untangle!

The key element *I* of cause am miss reading is the (Bar ...) which is a
type hint. That will not exist in any of the code prior to ? and that is
the key to what is being discussed. No type hint ... no change?

If someone 'improves' a third party library by adding type hints then
this is were the using code needs to be checked?

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to