# [PROPOSAL] Change (just slightly) read/write_property() and get_property_ptr_ptr() usage

- Thread: https://externals.io/message/28067
- Original archive: https://news-web.php.net/php.internals/28067
- Started by Michael Wallner on 2007-02-19T10:19:10+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #28067 — Michael Wallner — 2007-02-19T10:19:10+00:00

URL: https://externals.io/message/28067#28067

Hi,

I'd like to suggest a change to how the read_property object handler operates.

Wouldn't it be reasonable for the engine to use get_property_ptr_ptr() whenever
it wants to modify a property and get rid of using read_property() for write
access?

That would make rather simple ops like concatenation, in-/decrementation etc 
work again with overloaded internal classes.  Just make the engine use
read_property() followed by a write_property() when there's no
get_property_ptr_ptr().

Punish me if I'm really that far off.

Thoughts?
-- 
Michael

---

## #28068 — Peter Hodge — 2007-02-19T11:23:32+00:00

URL: https://externals.io/message/28067#28068 · In reply to: #28067

Hello,

Does that fix the problem where:

  $object->theArray[] = (...);

is invalid when 'theArray' is implemented using __get()?

Whoever fixes that one could get all free drinks at PHP conferences:

PHP Hacker: "Hi, I'm the guy who made it so you can add items to an array which
is returned through __get()"
PHP Fanboy: "Dude that is so awesome, how could I ever repay you!? Can I buy
you a beer?"

regards,
Peter




--- Michael Wallner <mike@php.net> wrote:

> Hi,
> 
> I'd like to suggest a change to how the read_property object handler
> operates.
> 
> Wouldn't it be reasonable for the engine to use get_property_ptr_ptr()
> whenever
> it wants to modify a property and get rid of using read_property() for write
> access?
> 
> That would make rather simple ops like concatenation, in-/decrementation etc 
> work again with overloaded internal classes.  Just make the engine use
> read_property() followed by a write_property() when there's no
> get_property_ptr_ptr().
> 
> Punish me if I'm really that far off.
> 
> Thoughts?
> -- 
> Michael
> 
> -- 
> 
> 
> 
> 


Send instant messages to your online friends http://au.messenger.yahoo.com

---

## #28070 — Michael Wallner — 2007-02-19T11:40:04+00:00

URL: https://externals.io/message/28067#28070 · In reply to: #28068

Peter Hodge wrote:
> Hello,
> 
> Does that fix the problem where:
> 
>   $object->theArray[] = (...);
> 
> is invalid when 'theArray' is implemented using __get()?

No. It's about internal classes and information stored in C structures.

Regards,
-- 
Michael
