> > > $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.)
>
> Thats true, but its more overhead calling a function than compare a
variable.
> Thats why i want to calll the function only once.

Umm... the function is only called once in both examples...

---John Holmes...


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

Reply via email to