On 16/07/18 12:14, Zeljko Mitic wrote:
But please, do keep in mind that I would like to have this feature as
optional.

The problem with most of these 'improvements' to PHP is that the case is always made that 'you do not have to use it' and this is yet another load on the code base that 'you do not have to use'. However SOMEONE will come up with a use in a library that means one has little option but to have to use it and switching off would break that.

As Yasuo has said, there are other ways of doing the same thing, and moving the 'problem' over to the IDE allows a LOT more flexibility in doing this sort of code management. The fact that once added, typehint is then a done deal, other areas will also be under pressure to enforce typing and we are stuck with one sides restricted view of how it should work. EVERY variable has a range of limitations and simply enforcing a 'number' when it also needs to be tested for size STILL needs the docblock comments to provide THAT information. Since most processing starts with text strings, enforcing binary data rules already needs some means of converting the input to binary and so is it really so bad to pass the raw variable and test that it is in the correct range within the function ... and PROPERLY handle an invalid input within the proper program flow rather than kicking it out to some other part of the code. Adding a valid default replacing the duff entry may be the correct response. Having to handle all of that BEFORE calling the function is simply the wrong way of programming!

Switches to control what features are enablled may no longer be politically correct, but not providing options for some of these 'extras' is just going to increase the pressure on not upgrading and nothing I am seeing for PHP7.3 gives me any reason to need to worry about using it at all ... typehints are certainly an extra negative to changing ... 7.0.x is stable on my LTS platform, so I'll stay on that ...

--
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