Re: Re: calling static class functions using a function variable

From: Date: Wed, 17 Jan 2001 21:58:28 +0000
Subject: Re: Re: calling static class functions using a function variable
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-44421@lists.php.net to get a copy of this message
On Wed, 17 Jan 2001, Rasmus Lerdorf wrote: > > Hi all, > > Hope you can help. I have an class called xml and a class method called > > hi_handler. I am able to call this method statically as follows: > > > > xml::hi_handler($attrs); > > > > but when I try to call it like this, it fails miserably: > > > > $junk="xml::hi_handler"; > > $junk(); > > > > Fatal error: Call to undefined function: xml::hi_handler() > > > > Any ideas - besides the obvious way of using a dummy instance. I am using > > php 4.0.3pl1 > > I wouldn't have expected that to work, but I did expect something like: > > xml::$func() > > to work. However I just tested it and it doesn't. Perhaps something that > can be fixed. > > -Rasmus That would be nice. Do you foresee any way to call a static function like $class::$fun()? -Shaun

« previous php.dev (#44421) next »