Re: Re: Clarification on the Enum language structure

From: Date: Thu, 24 Feb 2011 05:24:04 +0000
Subject: Re: Re: Clarification on the Enum language structure
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20  Groups: php.internals 
Request: Send a blank email to internals+get-51529@lists.php.net to get a copy of this message
Hi!
Don't your arguments work equally well against type hinting for objects? You have the same problems: if you screw something up in user code and pass the wrong type, it fails at runtime. You also get 'random' failures
It is true, however possibility of you having entirely different typo of object just substituted for needed object is much more remote, and you rarely read whole objects from config files without knowing what's there. You routinely read numbers and strings, and if you method accepts only certain kinds of numbers and strings, I think this should be handled in userspace - just as fopen() working only with certain kinds of strings (namely, valid filenames for one parameter and open options for another) is not done by typing. It probably could be, but I don't think it belongs in PHP. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#51529) next »