On Thu, Feb 26, 2015 at 2:10 AM, Dmitry Stogov <dmi...@zend.com> wrote: > Hi Anthony, > > What do you think about using a user level callback for strict type checks > instead of declare(). It won't allow changing behavior per file, but this > has its own cons and pros. > > <?php > set_strict_type_checker(function ($class_name, $function_nume, $arg_num, > $expected_type, $value, $file, $line) { > ... > return false; > }); > include("orig_index.php"); > ?> > > If callback is not set, arguments are converted according to standard > rules, if set and returns false - fatal error or exception is thrown. > > The implementation should be simpler and more efficient than using > declare().
It is too complex for what we need. The declare statement is as simple as "use.." present as the top of the file, has to be checked just like "use", no brainer for the users. Cheers, -- Pierre @pierrejoye | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php