[wp-hackers] Need help upgrading CG-Related plugin to
1.3...
Dennis Williamson
dennis at netstrata.com
Tue Oct 26 12:43:22 UTC 2004
No, empty() doesn't produce warnings, in the same way that isset() doesn't.
error_reporting(E_ALL);
unset($settest);
echo true == (isset($settest) == !empty($settest)) ? "True" :
"False"; // echoes "True" and produces no error
echo '' == $settest; // Notice: Undefined variable: settest
If I change "unset($settest);" to "$settest = '';" then "False" is echoed
and no error is produced.
Also, when I said "Isn't !empty() == isset(), always?" in my previous
message, I meant "Isn't !empty($x) == isset($x), always, whenever var $x;
(and no $x= ) or unset($x);?"
Dennis
At Tuesday 10/26/2004 06:50 AM, you wrote:
>Dennis,
>
>With your version you will get warnings if $_SERVER['QUERY_STRING']
>is not set.
>
>Regards,
>+ Kim
>--
><A HREF="http://kimmo.suominen.com/">Kimmo Suominen</A>
>
>On Tue, Oct 26, 2004 at 12:49:21AM -0500, Dennis Williamson wrote:
> > Oh!!!
> >
> > What about:
> >
> > if (!empty($_SERVER['QUERY_STRING'])) {
> > $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
> > }
> >
> > Isn't !empty() == isset(), always?
> >
> > Dennis
More information about the hackers
mailing list