On Wed, 23 Feb 2011, Stas Malyshev wrote: > > > > public function Killjoy(MyEnum $x) > > > > > > What would be the purpose of such code? What would it do if 5 is > > > passed as $x? > > > > IMHO, it should fail (unless 5 is the value explicitly mentioned in > > MyEnum definition) > > So before calling this method you better check it's argument against all > possible enum values, otherwise it's fatal error, right? Doesn't seem as very > helpful interface to me.
You'd rather correct it to the closest value in the Enum, just like casting typehints? ;-) cheers, Derick -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php