Re: Type hinting misunderstood
| From: | Sam Barrow | Date: | Mon, 07 Jan 2008 03:52:41 +0000 |
| Subject: | Re: Type hinting misunderstood | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34567@lists.php.net to get a copy of this message | ||
On Sun, 2008-01-06 at 09:03 -0800, Mike Lively wrote:
> On Sun, 2008-01-06 at 10:55 -0500, Sam Barrow wrote:
>
> > function requireFile(string $file, bool $getOutput = false, array $args
> > // ...
> > This function will not be called using input data.
> >
>
> So is there some way you are ensuring that users of your code NEVER pass
> a value that trickled down from a checkbox on a form for $getOutput?
> (Just an example)
>
> Saying that something will not be called using some form of input data
> (either directly or through several chained calls) is kind of silly imo.
> I am sure there are better arguments/solutions than just saying "don't
> use it with 'input'".
All I can say is that it would be very bad programming practice to include a file based on input
data. However if someone was to do this, the worst that can happen is that they get an error and
realize they can't do that.
The purpose of this is for functions internal to the application that interact with eachother.