# (s|g)etStaticPropertyValue

- Thread: https://externals.io/message/15281
- Original archive: https://news-web.php.net/php.internals/15281
- Started by Timm Friebe on 2005-03-06T11:26:02+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

---

## #15281 — Timm Friebe — 2005-03-06T11:26:02+00:00

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

Hello,
I saw there are two new ReflectionClass methods:

  * getStaticPropertyValue()
  * getStaticPropertyValue()

How do these differ (excepting being one method call) from:

  $value= $reflectionClass->getProperty('instance')->getValue();

and

  $reflectionClass->getProperty('instance')->setValue($value);

?

Instead of adding all kinds of feature bloat to the Reflection API,
couldn't this be left to people who extend it?

And if we must have these methods because of performance reasons, why
restrict them to static properties? Just because I can write
$instance->{$variable} and not Classname::$variable?

-- 
Timm
If it ain't broken, it doesn't have enough features yet

---

## #15282 — sarose — 2005-03-06T11:50:46+00:00

URL: https://externals.io/message/15281#15282 · In reply to: #15281

I think for me, it is the most comfortable way to refelect the properties.
When it is refelecting
it should follow a std. pattern

----- Original Message ----- 
From: "Timm Friebe" <thekid@thekid.de>
To: "internals" <internals@lists.php.net>
Sent: Sunday, March 06, 2005 5:11 PM
Subject: [PHP-DEV] (s|g)etStaticPropertyValue


> Hello,
> I saw there are two new ReflectionClass methods:
>
>   * getStaticPropertyValue()
>   * getStaticPropertyValue()
>
> How do these differ (excepting being one method call) from:
>
>   $value= $reflectionClass->getProperty('instance')->getValue();
>
> and
>
>   $reflectionClass->getProperty('instance')->setValue($value);
>
> ?
>
> Instead of adding all kinds of feature bloat to the Reflection API,
> couldn't this be left to people who extend it?
>
> And if we must have these methods because of performance reasons, why
> restrict them to static properties? Just because I can write
> $instance->{$variable} and not Classname::$variable?
>
> -- 
> Timm
> If it ain't broken, it doesn't have enough features yet

---

## #15284 — Zeev Suraski — 2005-03-06T12:50:12+00:00

URL: https://externals.io/message/15281#15284 · In reply to: #15281

At 13:26 06/03/2005, Timm Friebe wrote:
>Hello,
>I saw there are two new ReflectionClass methods:
>
>   * getStaticPropertyValue()
>   * getStaticPropertyValue()
>
>How do these differ (excepting being one method call) from:
>
>   $value= $reflectionClass->getProperty('instance')->getValue();
>
>and
>
>   $reflectionClass->getProperty('instance')->setValue($value);
>
>?
>
>Instead of adding all kinds of feature bloat to the Reflection API,
>couldn't this be left to people who extend it?

I very much agree.

Zeev
