> Am 25.05.2016 um 17:57 schrieb James Gilliland <[email protected]>: > > This is a cool idea and continuation of the typing systems so I've been > sort of skimming this thread as its been discussed and this example and the > associated errors caught my attention. > >> class C { >> public $a; >> public int $b; >> public ?int $c; >> } >> $obj = new C; >> > > Excuse me if this has been addressed but to clarify, using that snippet, > would this also throw an error? > > var_dump($obj); > > If so, I see a lot of cursing in my future if this goes in. Like "what's > the bad data on this object that's getting in here? aww #$%^ that > deprecated property wasn't set so the whole thing blew up!" sort of > cursing. :(
These don't throw errors, they just won't appear upon foreach or print_r etc., just like other unset() properties. var_dump()/debug_zval_dump() are special casing it and display e.g. "uninitialized(int)" for $b. Bob -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
