Re: Re: ramble was [PHP] Not sure of my error
| From: | Chris Lee | Date: | Fri, 17 Nov 2000 11:43:39 +0000 |
| Subject: | Re: Re: ramble was [PHP] Not sure of my error | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-26019@lists.php.net to get a copy of this message | ||
Would you be able to provide an example of where isset() fails ? I have
never seen it not work. Ive seen it work wired, but it allways works.
<?
$a[0] = 0;
$a[1] = 1;
$a[2] = 2;
unset($a[0]);
unset($a[1]);
unset($a[2]);
if ( isset($a) )
echo "this will display";
unset($a);
if (isset($a) )
echo "this will NOT display";
?>
Just because you unset all the elements does not mean you delete the
variable itself. Think of it like a table in a database. just because you
delete all the elements in the table doesn't mean you've deleted the
table itself.
Chris Lee
Mediawaveonline.com
In article <20001117193300.A5308@zorka.com>, joe@earth.care2.com wrote:
>> This is silly. Even if it works the way you want it to, it's bad
>> style. If I joined your project late and had to look at it I would not
>> understand what you're trying to do.
>
> I'm telling you I've seen isset() fail - especially in PHP3. This is a
> habit I started a while ago and stuck with it because it's fail safe -
> you can preach isset() all you want, but the fact remains we (Jer and I
> both) use it on a very large PHP site (1 million page views and 1.4
> million members) and we haven't seen it fail yet.
>
> This is how we would explain it to you when you joined our team :O) On a
> site that large we can't risk something failing.
>
>> if you want to see if a var is set and non-zero, use
>> if((isset($var))&&($var!=0))
>
> Checking for int values is an entirely different story.
>
> --Joe
>
>
>>
>> - Mark
>>
>>
>>