Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92527 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10219 invoked from network); 20 Apr 2016 08:47:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2016 08:47:16 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.214 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.214 mail4-2.serversure.net Linux 2.6 Received: from [217.147.176.214] ([217.147.176.214:51795] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/C4-14036-11247175 for ; Wed, 20 Apr 2016 04:47:14 -0400 Received: (qmail 763 invoked by uid 89); 20 Apr 2016 08:47:11 -0000 Received: by simscan 1.3.1 ppid: 756, pid: 759, t: 0.0770s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.7?) (lester@rainbowdigitalmedia.org.uk@81.138.11.136) by mail4.serversure.net with ESMTPA; 20 Apr 2016 08:47:10 -0000 To: internals@lists.php.net References: <570EB67E.8010908@garfieldtech.com> <5B147E88-CC0A-4CBC-A49D-C7FE3BF557C0@zend.com> <6F.C3.12455.94C5F075@pb1.pair.com> <20160414094440.GF19347@phcomp.co.uk> <570FD94F.90703@fleshgrinder.com> <570FE8A9.4020809@gmail.com> <20.53.29891.17401175@pb1.pair.com> <57110BCD.5030009@garfieldtech.com> <571124C2.9040606@gmx.de> <57112F31.8070209@garfieldtech.com> <57167C35.8080601@gmail.com> <57168FCC.7000507@garfieldtech.com> <1461108875.2175.5.camel@kuechenschabe> Message-ID: <5717420E.3090501@lsces.co.uk> Date: Wed, 20 Apr 2016 09:47:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1461108875.2175.5.camel@kuechenschabe> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Re: Improving PHP's type system From: lester@lsces.co.uk (Lester Caine) 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