# zend_lookup_class()

- Thread: https://externals.io/message/673
- Original archive: https://news-web.php.net/php.internals/673
- Started by Andrei Zmievski on 2003-04-04T16:20:00+00:00
- Messages: 6
- 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

---

## #673 — Andrei Zmievski — 2003-04-04T16:20:00+00:00

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

Any objections to modifying zend_lookup_class() to support fully
qualified class names? Meaning, if it's passed 'A::B' it will lookup
class B in namespace A? This change would take a care of several places
in the code where class name can be passed.

-Andrei                                       http://www.gravitonic.com/

"Everything has its wonders, even darkness and silence, and I learn,
 whatever state I may be in, therein to be content." - Helen Keller

---

## #677 — Moriyoshi Koizumi — 2003-04-04T16:53:37+00:00

URL: https://externals.io/message/673#677 · In reply to: #673

+1, because your patch is likely to fix the issue #21094.

http://bugs.php.net/21094

Moriyoshi

Andrei Zmievski <andrei@gravitonic.com> wrote:

> Any objections to modifying zend_lookup_class() to support fully
> qualified class names? Meaning, if it's passed 'A::B' it will lookup
> class B in namespace A? This change would take a care of several places
> in the code where class name can be passed.
> 
> -Andrei                                       http://www.gravitonic.com/
> 
> "Everything has its wonders, even darkness and silence, and I learn,
>  whatever state I may be in, therein to be content." - Helen Keller

---

## #718 — Andi Gutmans — 2003-04-05T12:43:47+00:00

URL: https://externals.io/message/673#718 · In reply to: #673

I'm not sure if it's a good idea to change it or if we'd want a new 
function because zend_lookup_class() is used in the core executor and this 
would just slow it down. Can you give me an example of where you'd want 
this to work?

Andi

At 11:20 AM 4/4/2003 -0500, Andrei Zmievski wrote:
>Any objections to modifying zend_lookup_class() to support fully
>qualified class names? Meaning, if it's passed 'A::B' it will lookup
>class B in namespace A? This change would take a care of several places
>in the code where class name can be passed.
>
>-Andrei                                       http://www.gravitonic.com/
>
>"Everything has its wonders, even darkness and silence, and I learn,
>  whatever state I may be in, therein to be content." - Helen Keller

---

## #734 — Stanislav Malyshev — 2003-04-06T07:24:29+00:00

URL: https://externals.io/message/673#734 · In reply to: #673

AZ>> Any objections to modifying zend_lookup_class() to support fully
AZ>> qualified class names? Meaning, if it's passed 'A::B' it will lookup
AZ>> class B in namespace A? This change would take a care of several
AZ>> places in the code where class name can be passed.

Could you point out which places are these? 

-- 
Stanislav Malyshev, Zend Products Engineer   
stas@zend.com  http://www.zend.com/ +972-3-6139665 ext.109

---

## #760 — Andrei Zmievski — 2003-04-07T15:14:26+00:00

URL: https://externals.io/message/673#760 · In reply to: #718

> I'm not sure if it's a good idea to change it or if we'd want a new 
> function because zend_lookup_class() is used in the core executor and this 
> would just slow it down. Can you give me an example of where you'd want 
> this to work?

zend_builtin_functions.c:

    575: if (zend_lookup_class(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), &pce TSRMLS_CC) == SUCCESS) {
	673: if (zend_lookup_class(lcname, Z_STRLEN_PP(class_name), &pce TSRMLS_CC) == FAILURE) {
	740: if (zend_lookup_class(Z_STRVAL_PP(class), Z_STRLEN_PP(class), &pce TSRMLS_CC) == SUCCESS) {

Basically, any functions that take the name of a class and need to
obtain the corresponding class entry, should also be able to take the
namespace::class syntax. zend_lookup_class() seems like the best place
to accomplish it. Any other suggestions?

-Andrei                                       http://www.gravitonic.com/
* Gun manufacturers don't make bad products, bad parents do. *

---

## #761 — Andrei Zmievski — 2003-04-07T15:14:41+00:00

URL: https://externals.io/message/673#761 · In reply to: #734

> AZ>> Any objections to modifying zend_lookup_class() to support fully
> AZ>> qualified class names? Meaning, if it's passed 'A::B' it will lookup
> AZ>> class B in namespace A? This change would take a care of several
> AZ>> places in the code where class name can be passed.
> 
> Could you point out which places are these? 

See my reply to Andi.

-Andrei                                       http://www.gravitonic.com/
* Change is the only constant. *
