Re: property de-referencing
| From: | Rasmus Schultz | Date: | Tue, 30 Apr 2013 20:24:00 +0000 |
| Subject: | Re: property de-referencing | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67222@lists.php.net to get a copy of this message | ||
That looks more pointless than evil to me - and no, I'm not suggesting
anything of that sort.
I'm proposing we need a way to statically reference an object property -
the object property itself, not it's value:
var_dump($user->name); // => 'Rasmus'
var_dump(^$user->name); // => PropertyReference(class: 'User',
propertyName: 'name', object:User(...))
$foo = ^$user->name;
var_dump($foo->getValue()); // => 'Rasmus'
$foo->setValue('Bob');
var_dump($user->name); // => 'Bob'
Is that easier to understand?
- Rasmus Schultz
On Tue, Apr 30, 2013 at 1:01 PM, Ferenc Kovacs <tyra3l@gmail.com> wrote:
>
> 2013.04.30. 14:00, "Rasmus Schultz" <rasmus@mindplay.dk> ezt írta:
>
> >
> > >
> > > Do you mean something yucky like
> > > http://pecl.php.net/propro?
> > >
> > >
> > I don't know what that is, and there is no description on that page.
>
> you can grasp the concept from the testcase:
>
>
> http://git.php.net/?p=pecl/php/propro.git;a=blob_plain;f=tests/001.phpt;hb=HEAD
>
>