On 20/04/16 00:34, Johannes Schlüter wrote:
> On Wed, 2016-04-20 at 00:09 +0200, Marco Pivetta wrote:
>> > In Doctrine ORM, having a way to know that a field or parameter is a
>> > `string | null` or a `int | float` may be the difference between
>> > knowing
>> > what kind of column definition is needed for a field at DB level,
>> > without
>> > even need for defining manual mappings.
> So what's the column definition if you see `string | null`? A PHP string
> can have (almost) arbitrary length and binary data, so this is a BLOB?
> Most likely not what the user wants. 
> 
> The PHP type hardly describes the constraints by the application. This
> might add a small sanity check but by no means a game changer.

String length, size of integer and accuracy of numeric all affect the
definition of the schema at the DB level which adding a little twiddly
bit does nothing to provide an expandable type definition. I'm not
objecting to a type system per-say but even the bits that have been
bodged into PHP7 already do not provide a route forward for REAL data
validation?

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