Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Lester Caine
On 01/06/16 22:09, Rasmus Schultz wrote: > This tendency to "defend" the dynamic side of the language, as though > static features were somehow an "attack" on dynamic features, befuddles me. > > These two sides of the language do not compete with each other - they > complement each other. That is

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Rasmus Schultz
> The drive to make everything as 'static' as possible misses > the whole point that PHP is a DYNAMIC scripting system. I think that line of argumentation is pretty outdated - it may have been valid many years ago, but by now, PHP is not purely dynamic; far from it. It's a gradually-typed language

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Lester Caine
On 01/06/16 21:09, Jesse Schalken wrote: > On Wed, Jun 1, 2016 at 7:40 PM, Lester Caine wrote: > >> Morphed into simply passing an array to the constructor ... >> >> $static1 = new Data\StaticVariable( array( >> 'name' => 'variable name', >> 'value'

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Jesse Schalken
On Thu, Jun 2, 2016 at 12:38 AM, guilhermebla...@gmail.com < guilhermebla...@gmail.com> wrote: > Hi, > > I very much liked the proposal, specially if we do consider a potential > reusability if anyone ever decide to revisit Attributes RFC. It's out of > scope how I'd see this implemented, so let m

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Jesse Schalken
On Wed, Jun 1, 2016 at 7:49 PM, Peter Cowburn wrote: > > While it's not as concise as your example, anonymous classes can do this > already after a fashion. > > $this->fooMethod( > $arg1, > $arg2, > new class() extends FooParams { > // Constructor because prop3's value isn't a

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Jesse Schalken
On Wed, Jun 1, 2016 at 7:40 PM, Lester Caine wrote: > Morphed into simply passing an array to the constructor ... > > $static1 = new Data\StaticVariable( array( > 'name' => 'variable name', > 'value'=> $unknown1, > 'functionName' => 'b

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Alex Duchesne
On 2016-05-31 22:15, Jesse Schalken wrote: Hi internals, I often have code dealing with plain old PHP objects with properties and no methods, either as a substitute for keyword arguments, or to represent a JSON or YAML document for a web service, configuration file or schemaless database. At th

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Fleshgrinder
On 6/1/2016 5:47 PM, Ryan Pallas wrote: > On Wed, Jun 1, 2016 at 9:37 AM, Matt Fonda wrote: >> >> >> Hi Jesse, >> >> It's fairly straightforward to implement a function that does this in >> userland, for example something like the following: >> >> function f($fqcn, $args) { >> $instance = new

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Ryan Pallas
On Wed, Jun 1, 2016 at 9:37 AM, Matt Fonda wrote: > > > Hi Jesse, > > It's fairly straightforward to implement a function that does this in > userland, for example something like the following: > > function f($fqcn, $args) { > $instance = new $fqcn; > foreach ($args as $key => $value) { >

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Matt Fonda
On Tue, May 31, 2016 at 7:15 PM, Jesse Schalken wrote: > Hi internals, > > I often have code dealing with plain old PHP objects with properties and no > methods, either as a substitute for keyword arguments, or to represent a > JSON or YAML document for a web service, configuration file or schema

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread guilhermebla...@gmail.com
Hi, I very much liked the proposal, specially if we do consider a potential reusability if anyone ever decide to revisit Attributes RFC. It's out of scope how I'd see this implemented, so let me focus on the proposal only. There're some edge cases that need to be discussed and considered here. Her

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Peter Cowburn
On 1 June 2016 at 03:15, Jesse Schalken wrote: > Hi internals, > > I often have code dealing with plain old PHP objects with properties and no > methods, either as a substitute for keyword arguments, or to represent a > JSON or YAML document for a web service, configuration file or schemaless > d

Re: [PHP-DEV] Set object properties inline

2016-06-01 Thread Lester Caine
On 01/06/16 03:15, Jesse Schalken wrote: > For large structures, this gets verbose very quick. There is a good example > of this here > > involving > 18 unnecessarily vari

[PHP-DEV] Set object properties inline

2016-05-31 Thread Jesse Schalken
Hi internals, I often have code dealing with plain old PHP objects with properties and no methods, either as a substitute for keyword arguments, or to represent a JSON or YAML document for a web service, configuration file or schemaless database. At the moment, instantiating an object and setting