On 09/04/2019 08:32, Guilliam Xavier wrote:
I do kind of like the idea in the RFC, but I think it needs a better
argument for it.
For your other points, I find that Claude Pache has given pretty good
arguments in the meantime (thanks!) =) (By the way, I also thought
about say, "nullable_intval()", "nullable_strval()" etc. but we're
missing "arrayval()" and "objectval()"...)

The debate as always is between those for who 'NULL' is a key STATE that is part of the interaction between a database and program and those who do not have that need. In my world a variable has a number of states and NULL is simply one of them. Thinking of NULL as 'uninitialized' is a reasonable match, and when pushing a variable to a database it's NULL state can be used to trigger loading a default value or to leave the field unset for later handling. HAVING to put a value or a string into the variable because 'it must have a type' is simply wrong. But the need now to HAVE to cast at times is equally wrong? I'm still hitting errors in stuff being moved to 7.2 where the 'fix' is adding a cast, to keep PHP happy, but then the value may well be a NULL return from the data set so one almost ends up needing two versions of a variable ... one to keep the now stricter typing happy and one to store the actual data returned from the database. This also links up with the leading and trailing spaces discussion. That the working value is a left justified or right justified number but the logic now requires an 'int' to keep it quiet is pushing towards needing these separate versions of essentially the same variable :( Making the associative array view of the data difficult to manage ...

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

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

Reply via email to