On Jan 6, 2008 5:55 PM, Sam Barrow <[EMAIL PROTECTED]> wrote:
> As I said, this patch is not intended for stuff like $_GET, $_POST,
> database data, etc. It is intended for internal functions to your
> application.
>
> function requireFile(string $file, bool $getOutput = false, array $args
> = array())
>         {
>                 $obLevel = ob_get_level() ;
>
>                 ob_start() ;
>
>                 $return = require_once($file) ;
>
>                 if ($getOutput)
>                         {
>                                 $return = ob_get_clean() ;
>                         }
>                 else
>                         {
>                                 if ($_mod['base']['output']['strict'] and 
> ob_get_length() > 0)
>                                         {
>                                                 ::error::go('Output generated 
> in file "' . $file . '".') ;
>                                         }
>
>                                 ob_end_clean() ;
>                         }
>
>                 if ($obLevel !== ob_get_level())
>                         {
>                                 ::error::go('Output buffering level mismatch 
> after inclusion of file
> "' . $file . '".') ;
>                         }
>
>                 return $return ;
>         }
>
> This function will not be called using input data.

I have been watching type hinting for a while now and one thing I
don't understand: hows my object of class lets say FileName that
implements __toString() is wrong parameter for your requireFile()? Why
should I every time calling a function cast variables manually when it
can be perfectly done by PHP automatically?

Sorry for intrusion and thanks for your time.

Giedrius

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

Reply via email to