Re: Speed Question
| From: | JJ Harrison | Date: | Thu, 18 Jul 2002 13:03:57 +0000 |
| Subject: | Re: Speed Question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-108483@lists.php.net to get a copy of this message | ||
thx
"Jason Wong" <php-general@gremlins.com.hk> wrote in message
news:200207191937.35698.php-general@gremlins.com.hk...
> On Thursday 18 July 2002 19:32, JJ Harrison wrote:
> > if I do this:
> >
> > if(validate($_POST['password'], $_POST['username']) != 0)
> > echo validate($_POST['password'], $_POST['username']);
> >
> > will it execute the function twice or use the same result twice?
>
> Function executes twice.
>
> > would it be (slightly) faster to do this:
> >
> > $uid = validate($_POST['password'], $_POST['username'])
> > if($uid != 0)
> > echo $uid);
>
> Probably.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> If fifty million people say a foolish thing, it's still a foolish thing.
> -- Bertrand Russell
> */
>