Re: Class type in static method

From: Date: Wed, 28 May 2008 17:20:06 +0000
Subject: Re: Class type in static method
References: 1  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-5475@lists.php.net to get a copy of this message
hi i think it is possible starting with php 5.3 first where EG(called_scope) can be used. For earlier versions you could make the child class name firmly or make a private property with the class name ... regards Anatoliy On Wednesday 28 May 2008 09:53, Osman A. Osman (عثمان) wrote: > Hello, > I was trying to write a small extension to get the hang of things, and > was wondering how I could get the class-type in a PHP_METHOD called > statically. > > Let me clarify: > I have a PHP_METHOD(SomeClass, staticMethod) { > > } > > This method is called statically, by a class that extends SomeClass. How > can I determine what the real type is of the caller? > If this method was not static, I could do something like: *string > current_type = Z_OBJCE_P(getThis())->name;* > But since this was called staticall, I do not have getThis(). Is there > another way to get the class_entry object? > > Thanks!

« previous php.pecl.dev (#5475) next »