On 15/04/16 18:58, Dmitry Stogov wrote:
> I'm sure, union types bring too many conceptual and implementation questions, 
> and I even don't speak abut intersections.

The one problem I see with all of this is that it is reliant on every
single variable being passed in when in early PHP5 days the preference
was to move to hashes of data passed as arrays to open up flexibility.
None of my record handling currently relies on having every 'parameter'
formally defined, and elements of the record that are not passed in the
hash are most definitely replaced by null valued elements allowing the
DB engine to supply the relevant schema default unless it is replaced by
additional variable in the data array.

The idea of converting every record array into an object with multiple
'typed' variables seems to me to be a total overload to me, but if that
is what people think is essential to make PHP 'safer' then that some of
those variables are inherently 'null' or need to be switched to null if
a change is required back to the schema default. 'Union' does not fit
easily into this model?

Documenting the content of a record hash via the docblock comments fits
perfectly with this method working ...

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