Re: A different user perspective on scalar type declarations

From: Date: Thu, 26 Feb 2015 22:28:15 +0000
Subject: Re: A different user perspective on scalar type declarations
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-83932@lists.php.net to get a copy of this message
On 26/02/15 21:28, Zeev Suraski wrote: >> Yes, the database use case and exterior data has been my main concern over >> > the type hint proposals. Now, this could also be changed (fixed, etc) on >> > a >> > different layer (aka database extensions to deal with native types) but >> > that is >> > likely far more to bite off than one would want at this point. It is >> > relatively >> > painless to go in and cast all of those types but the amount of code out >> > there >> > which people are going to just 'expect' this to work will be fairly large >> > and >> > one of those cases that will possibly be cause for migration concerns. > Thanks a lot for the input! We'll reconsider accepting "1"/"0" as > valid > Booleans as the original proposal did. Using a 'char' or other binary field type as multiple boolean flags also resolve to 1 and 0 when pulled apart. The debate from the other side is if there is a need for a 'boolean' field type. http://www.firebirdmanual.com/firebird/en/firebird-manual/2/simulating-boolean-in-firebird/51 and http://www.firebirdfaq.org/faq12/ show some options used to get around the various input problems. So like PHP - no agreement on what BOOL is. FB3.0 is still in development, but adds a bool field for which IS_TRUE and IS_FALSE are not a comfortable fit because for any database a field can have a value or be null (not set) ... this therefore requires using a zval other than IS_TRUE/IS_FALSE to store a boolean value properly! -- 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

« previous php.internals (#83932) next »