Re: PHP 7.1 - Address PHPSadness #28?
| From: | Lester Caine | Date: | Fri, 18 Sep 2015 12:01:34 +0000 |
| Subject: | Re: PHP 7.1 - Address PHPSadness #28? | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88319@lists.php.net to get a copy of this message | ||
On 18/09/15 12:38, Lester Caine wrote:
> Forget enum and more than three values in a variable ...
>
> For SQL data coming from any decent database each variable can either
> have a value in, ( which may be an empty string ) or be NULL. The NUMBER
> of fields returned does not matter, a query returning a single record
> can have a variable so the third condition is that rather than a field
variable NUMBER OF FIELDS so
> being NULL, it does not exist, so testing for isset() only works for a
> field that 'is set' and empty() only works with an empty value. Checking
> for the field being present but NULL needs is_null() but THAT throws a
> notice for those fields which have not been returned in this particular
> result set. And one scenario here is that the database scheme actually
> needs updating - but that should be handled differently - however a
> system may have picked up an old copy of the data by mistake and the
> missing fields need handling cleanly.
>
> We are not talking about the number of states stored IN a variable, but
> just what a variables own states are. Adding another variable to
> enumerate what say 'a date relates to' is a different matter. The date
> value can be a valid date ( and genealogical date goes back before most
> 'empty' date values ) or NULL indicating no date set OR the variable can
> be missing from the result set. If you add in 'empty' one might say we
> have for distinct states?
FOUR distinct states
( and date is a good example here since 'empty' on something like MySQL
is a valid date genealogically )
--
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