Thats true, but its more overhead calling a function than compare a variable.
Thats why i want to calll the function only once.

- Svein

On Thursday 05 June 2003 14:03, Ford, Mike [LSS] wrote:
> > -----Original Message-----
> > From: Svein Larsen [mailto:[EMAIL PROTECTED]
> > Sent: 04 June 2003 16:22
> >
> > $gd_loaded = (extension_loaded('gd'))?1:0;
>
> Well, this also fails the simple-as-possible test: if the value returned by
> extension_loaded() can be used to drive the ?: operator, it must be
> evaluable as a Boolean; this means you can use it directly for later use in
> an if() or similar context:
>
>    $gd_loaded = extension_loaded('gd');
>
> (And, indeed, a quick look at the manual reveals that extension_loaded
> returns a bool, which is exactly what you want without any further ado.)
>
> Cheers!
>
> Mike
>
> ---------------------------------------------------------------------
> Mike Ford,  Electronic Information Services Adviser,
> Learning Support Services, Learning & Information Services,
> JG125, James Graham Building, Leeds Metropolitan University,
> Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
> Email: [EMAIL PROTECTED]
> Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to