Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Lester Caine
On 27/05/16 18:25, Rowan Collins wrote: > On 27 May 2016 10:53:05 GMT+01:00, Lester Caine wrote: >>On 27/05/16 10:16, Rowan Collins wrote: >>> The most useful typehints are inside the SomeModel class, not the >>> table-level wrapper. This is true even if they're just dumb

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Fleshgrinder
On 5/27/2016 7:48 PM, Rowan Collins wrote: > On 27 May 2016 11:25:48 GMT+01:00, Fleshgrinder wrote: >> if (isset($row['d'])) { >>$o->d = new DateTime($row['d']); >> } >> >> No need to assign null since it already is null by default and the >> nullable hint will not

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Rowan Collins
On 27 May 2016 11:25:48 GMT+01:00, Fleshgrinder wrote: > if (isset($row['d'])) { >$o->d = new DateTime($row['d']); > } > >No need to assign null since it already is null by default and the >nullable hint will not result in any errors upon accessing it. Actually,

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Rowan Collins
On 27 May 2016 13:34:17 GMT+01:00, Lester Caine wrote: >Hence the 'in an ideal world'! It is perhaps worth making clear that a >'typed property' element IS simply a holder for the pointer to the real >element while the untyped properties are the element themselves? In

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Rowan Collins
On 27 May 2016 10:53:05 GMT+01:00, Lester Caine wrote: >On 27/05/16 10:16, Rowan Collins wrote: >> The most useful typehints are inside the SomeModel class, not the >> table-level wrapper. This is true even if they're just dumb structs, >and >> all the behaviour is at the

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Lester Caine
On 27/05/16 15:12, Ryan Pallas wrote: > Now you can blindly initialize it, and call format on it, whether or not > the date is provided. This is all controllable in userland, there is no > reason to make the language do it for you, as its purely a design decision. Which has been the main argument

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Ryan Pallas
On Fri, May 27, 2016 at 6:34 AM, Lester Caine wrote: > On 27/05/16 11:25, Fleshgrinder wrote: > > On 5/27/2016 11:41 AM, Lester Caine wrote: > >> Now I am confused, but it's probably because I'm looking at a simple > >> > >> $f->d = new DateTime( $initial ); > >> > >> While

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Fleshgrinder
On 5/27/2016 2:34 PM, Lester Caine wrote: > Hence the 'in an ideal world'! It is perhaps worth making clear that a > 'typed property' element IS simply a holder for the pointer to the real > element while the untyped properties are the element themselves? The > differentiation of 'scalar' probably

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Lester Caine
On 27/05/16 11:25, Fleshgrinder wrote: > On 5/27/2016 11:41 AM, Lester Caine wrote: >> Now I am confused, but it's probably because I'm looking at a simple >> >> $f->d = new DateTime( $initial ); >> >> While you are looking at >> >> If ( isset($initial) ) >> then $f->d = new DateTime( $initial );

[PHP-DEV] NEUTRAL Benchmark Results for PHP Master 2016-05-27

2016-05-27 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-05-27 06:28:00+03:00 commit: 42be298 previous commit:2ae21ab revision date: 2016-05-26 03:06:32+02:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Fleshgrinder
On 5/27/2016 11:53 AM, Lester Caine wrote: > On 27/05/16 10:16, Rowan Collins wrote: >> My comment was in reaction to Lester expressing surprise at destroying >> and re-creating objects when new data is fetched. To be clear, I'm >> talking about this: >> >> // Clear old data >> $this->data = [];

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Fleshgrinder
On 5/27/2016 11:41 AM, Lester Caine wrote: > Now I am confused, but it's probably because I'm looking at a simple > > $f->d = new DateTime( $initial ); > > While you are looking at > > If ( isset($initial) ) > then $f->d = new DateTime( $initial ); > else $f->d = null; > > While the original

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Lester Caine
On 27/05/16 10:16, Rowan Collins wrote: > My comment was in reaction to Lester expressing surprise at destroying > and re-creating objects when new data is fetched. To be clear, I'm > talking about this: > > // Clear old data > $this->data = []; > // Re-populate from new DB result > foreach (

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Christoph Becker
On 27.05.2016 at 10:27, Rowan Collins wrote: > On 26/05/2016 23:03, Lester Caine wrote: >> On 26/05/16 22:38, Rowan Collins wrote: > // accessing $me->marriage or $me->death returns NULL (because they >> allow nulls) but raises E_NOTICE BUT DateTime currently will not store 'null' -

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Lester Caine
On 27/05/16 09:27, Rowan Collins wrote: > // accessing $me->marriage or $me->death returns NULL (because they >> allow nulls) but raises E_NOTICE BUT DateTime currently will not store 'null' - it returns 'now' instead. We end up having to store string or integer values

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Rowan Collins
On 27/05/2016 09:35, Tony Marston wrote: "Lester Caine" wrote in message news:5747f02a.2010...@lsces.co.uk... On 26/05/16 22:36, Rowan Collins wrote: So every time I update the current tree because the client has selected a different initial root I have to destroy perhaps 30 person objects

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Fleshgrinder
On 5/27/2016 10:35 AM, Tony Marston wrote: > I disagree completely. In a database system there is no rule that says > an object can only hold data from a single row otherwise Martin Fowler, > the author of PoEE, would not have patterns that hold data from several > rows. When I instantiate one of

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Tony Marston
"Lester Caine" wrote in message news:5747f02a.2010...@lsces.co.uk... On 26/05/16 22:36, Rowan Collins wrote: So every time I update the current tree because the client has selected a different initial root I have to destroy perhaps 30 person objects and rebuild the whole lot again from

[PHP-DEV] PHP 5.5.36 is available

2016-05-27 Thread Julien Pauli
Hello! The PHP development team announces the immediate availability of PHP 5.5.36. Several security related issues were fixed in this release. All PHP 5.5 users are encouraged to upgrade to this version. For source downloads of PHP 5.5.36 please visit our downloads page:

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Fleshgrinder
On 5/26/2016 11:40 PM, Rowan Collins wrote: > On 26/05/2016 21:00, Fleshgrinder wrote: >> PS: This needs a cast unless some special driver options are active. >> >>$me->numSiblings = (int) $db_record['num_siblings']; > > ...or unless strict_types=0, in which case PHP will add an implicit cast

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Rowan Collins
On 26/05/2016 23:03, Lester Caine wrote: On 26/05/16 22:38, Rowan Collins wrote: // accessing $me->marriage or $me->death returns NULL (because they allow nulls) but raises E_NOTICE BUT DateTime currently will not store 'null' - it returns 'now' instead. We end up having to store string or

Re: [PHP-DEV] [RFC][Vote] Typed Properties

2016-05-27 Thread Lester Caine
On 26/05/16 22:36, Rowan Collins wrote: >> So every time I update the current tree because the client has selected >> a different initial root I have to destroy perhaps 30 person objects and >> rebuild the whole lot again from scratch? > > In a word, yes: if you have a different set of data, use