On 26/02/15 11:34, Benjamin Eberlei wrote:
>> You 'll have to think about each file anyway. To add or not to add
>> > declare(strict_types=1).
>> >
> Yes, but It has only exactly one ruleset to keep in mind. With your
> approach the ruleset space is infinite. Much more complex.

Currently the rule set is already 'infinite' since many libraries will
already be checking for their own conditions and verifying they have a
valid variable to start with is the first step. The nice thing about PHP
*IS* it's flexibility in the way one is not constrained by a single core
framework and the more I look at this, the more making PHP a little more
flexible makes sense. Being able to bolt in a validation system
appropriate to the library being used makes perfect sense, but I already
see that code in the libraries I use anyway. The problem with proper
validation is that it either needs the annotation RFC to allow
definition of all the rules or access to some other data model such as
the metadata of a database. Simply saying 'int' and then blocking all
valid forms of that value is only part of the process but providing a
mechanism that CAN be optimised for the target and which can be enhanced
via that target can only be an improvement on what is proposed so far.

And the title here is wrong - this is not restricted to 'strict' it
applies to all scalar type hinting/checking.

-- 
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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

Reply via email to