# Property access slowness

- Thread: https://externals.io/message/1970
- Original archive: https://news-web.php.net/php.internals/1970
- Started by Sterling Hughes on 2003-05-24T16:15:26+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

---

## #1970 — Sterling Hughes — 2003-05-24T16:15:26+00:00

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

Hi,

Property access with PHP5 is very slow compared to PHP4.  The reason for
this is that property access must be verified *every* time.  This seems
really unnecessary unless we're indirectly accessing properties.

Can/Should this be moved to zend_compile.c for everything that doesn't
rely on indirect reference?

-Sterling
-- 
"Programming today is a race between software engineers stirring to  
 build bigger and better idiot-proof programs, and the universe trying  
 to produce bigger and better idiots. So far, the universe is winning." 
    - Unknown

---

## #1976 — Andi Gutmans — 2003-05-25T04:08:38+00:00

URL: https://externals.io/message/1970#1976 · In reply to: #1970

At 12:15 PM 5/24/2003 -0400, Sterling Hughes wrote:
>Hi,
>
>Property access with PHP5 is very slow compared to PHP4.  The reason for
>this is that property access must be verified *every* time.  This seems
>really unnecessary unless we're indirectly accessing properties.
>
>Can/Should this be moved to zend_compile.c for everything that doesn't
>rely on indirect reference?

Which accesses are slower,  $obj->prop, $this->prop or both?

Andi

---

## #1978 — Zeev Suraski — 2003-05-25T08:24:48+00:00

URL: https://externals.io/message/1970#1978 · In reply to: #1970

At 19:15 24.05.2003, Sterling Hughes wrote:
>Hi,
>
>Property access with PHP5 is very slow compared to PHP4.  The reason for
>this is that property access must be verified *every* time.  This seems
>really unnecessary unless we're indirectly accessing properties.

It has to be verified each time, because we're typeless, and can't do stuff 
like that in compile time.  It's not related to indirect reference...

Zeev
