Re: function within a class function
| From: | Rick Pasotto | Date: | Mon, 21 Jun 2010 02:44:01 +0000 |
| Subject: | Re: function within a class function | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-306277@lists.php.net to get a copy of this message | ||
On Sun, Jun 20, 2010 at 08:47:53PM -0400, Brandon Rampersad wrote:
> $this->usort();
> self::usort();
>
> On Sun, Jun 20, 2010 at 7:45 PM, Rick Pasotto <rick@niof.net> wrote:
>
> > Within a class function I have defined another function for use with the
> > usort() function. How do I reference it?
> >
> > When it's not part of a class usort($arr,"cmp") works fine but when
> > it's
> > within a class function I get this error:
> >
> > PHP Parse error: syntax error, unexpected T_STRING, expecting T_FUNCTION
> >
> > Is it not in the scope of the class function?
Forgive my ignorance but I have absolutely no idea what you're trying to
tell me.
usort() is part of the language so when, why, how does it become an
object of some class?
--
"We have rights, as individuals, to give as much of our own money as
we please to charity; but as members of Congress we have no right so
to appropriate a dollar of public money." -- David Crockett
Rick Pasotto rick@niof.net http://www.niof.net