Hi,
I've created a PR here: https://github.com/php/php-src/pull/1325
This enhancement allows for properties on objects to work in the same way
as arrays for the inner elements of the main array.
It also supports the __get() method, provided that also __isset() is
implemented and returns true for the addressed property.
The only BC I can imagine is when an array is populated with a mixed set of
objects and arrays; any professional would baulk at the idea, but rules of
the jungle are pervasive.
Before I merge this, are there any objections to shipping this with 7.0?
Hey:
On Fri, Jun 12, 2015 at 9:31 AM, Tjerk Meesters
tjerk.meesters@gmail.com wrote:
Hi,
I've created a PR here: https://github.com/php/php-src/pull/1325
This enhancement allows for properties on objects to work in the same way
as arrays for the inner elements of the main array.
IMO, it is called (array)_column...
and if you really want do it against object, you can always easily
convert the object to array.
thanks
It also supports the __get() method, provided that also __isset() is
implemented and returns true for the addressed property.The only BC I can imagine is when an array is populated with a mixed set of
objects and arrays; any professional would baulk at the idea, but rules of
the jungle are pervasive.Before I merge this, are there any objections to shipping this with 7.0?
--
Xinchen Hui
@Laruence
http://www.laruence.com/
Hey:
On Fri, Jun 12, 2015 at 9:31 AM, Tjerk Meesters
tjerk.meesters@gmail.com wrote:Hi,
I've created a PR here: https://github.com/php/php-src/pull/1325
This enhancement allows for properties on objects to work in the same way
as arrays for the inner elements of the main array.IMO, it is called (array)_column...
Please read more carefully, it's about supporting objects as the inner elements of an array, not instead of an array.
and if you really want do it against object, you can always easily
convert the object to array.thanks
It also supports the __get() method, provided that also __isset() is
implemented and returns true for the addressed property.The only BC I can imagine is when an array is populated with a mixed set of
objects and arrays; any professional would baulk at the idea, but rules of
the jungle are pervasive.Before I merge this, are there any objections to shipping this with 7.0?
--
Xinchen Hui
@Laruence
http://www.laruence.com/
Hi,
I've created a PR here: https://github.com/php/php-src/pull/1325
This enhancement allows for properties on objects to work in the same
way
as arrays for the inner elements of the main array.It also supports the __get() method, provided that also __isset() is
implemented and returns true for the addressed property.The only BC I can imagine is when an array is populated with a mixed
set of
objects and arrays; any professional would baulk at the idea, but rules
of
the jungle are pervasive.Before I merge this, are there any objections to shipping this with
7.0?
Sounds like a useful and well thought out addition to me. Like array_column itself, it's easily implemented (and, indeed, emulated) in userland, but having it in the standard library helps everyone have the same version out of the box.
Regards,
Rowan Collins
[IMSoP]
On Sat, Jun 13, 2015 at 11:46 AM, Rowan Collins rowan.collins@gmail.com
wrote:
On 12 June 2015 02:31:18 BST, Tjerk Meesters tjerk.meesters@gmail.com
wrote:Hi,
I've created a PR here: https://github.com/php/php-src/pull/1325
This enhancement allows for properties on objects to work in the same
way
as arrays for the inner elements of the main array.It also supports the __get() method, provided that also __isset() is
implemented and returns true for the addressed property.The only BC I can imagine is when an array is populated with a mixed
set of
objects and arrays; any professional would baulk at the idea, but rules
of
the jungle are pervasive.Before I merge this, are there any objections to shipping this with
7.0?Sounds like a useful and well thought out addition to me. Like
array_column itself, it's easily implemented (and, indeed, emulated) in
userland, but having it in the standard library helps everyone have the
same version out of the box.
I agree. This is probably the most-asked-for update to array_column()
that
I hear, and I haven't had time to implement it, so this is great.
Cheers,
Ben