Re: zend_lookup_class()

From: Date: Mon, 07 Apr 2003 19:52:16 +0000
Subject: Re: zend_lookup_class()
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-766@lists.php.net to get a copy of this message
At 11:14 AM 4/7/2003 -0400, Andrei Zmievski wrote:
On Sat, 05 Apr 2003, Andi Gutmans wrote: 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?
As zend_lookup_class() is used in the main executer of the engine I'd want to keep it as slim as possible. If you want to create a zend_foo_bar() function which does what you want, feel free to add it but it shouldn't be used in core stuff. Andi

« previous php.internals (#766) next »