Robert Stoll wrote (on 16/09/2014):
I would argue "type declaration" is wrong as well since it is not a type
declaration as it is known in other languages where the type declaration is
binding. IMO it is more a "type check". Consider the following

function foo(Bar $b){
   $b = 1; //$b is not a Bar at all
}

I tend to think of them as "type assertions", since this:

function foo(Bar $b){
    // do stuff
}

is kind of equivalent to this:

function foo($b){
    assert($b instanceOf Bar);
    // do stuff
}

i.e. it's a runtime-enforced check

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

Reply via email to