Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread Cristiano Duarte
+1 for variable_exists Cristiano Duarte "Lars Torben Wilson" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] > On Thu, 2003-08-14 at 08:42, Andi Gutmans wrote: > > I am not really convinced either that variable_exists() is > > function_exists() parallel. > > Under what circumstanc

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread Lars Torben Wilson
On Thu, 2003-08-14 at 12:41, Derick Rethans wrote: > On Thu, 14 Aug 2003, walt boring wrote: > > > Then please explain the logic of why > > $var = null > > > > isset($var) returns false. > > > > In your words "it will see if a variable is set (has a value)". > > > > $var IS set and DOES have a

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread Ilia Alshanetsky
On August 14, 2003 03:33 pm, Robert Cummings wrote: > Actually isset() doesn't behave as it should: > > $foo = null; > echo isset( $foo ); Not quite. To understand the nature of NULL you must consider the following. Suppose you have a variable $foo you wish to 'destroy' you can do so by d

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread Lars Torben Wilson
On Thu, 2003-08-14 at 13:17, Mårten Gustafson wrote: > Lars Torben Wilson ([EMAIL PROTECTED]) wrote: > > unset($foo) is not the same as $foo = NULL, which is one way this > > According to the manual, it is. > http://www.php.net/manual/en/language.types.null.php > > /mårten. According to the behav

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread walt boring
Not quite. To understand the nature of NULL you must consider the following. Suppose you have a variable $foo you wish to 'destroy' you can do so by doing unset($foo) or $foo = NULL;. In both cases the value of $foo will be destroyed, however the variable will remain, it's value will become NU

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread Lars Torben Wilson
On Thu, 2003-08-14 at 12:59, Ilia Alshanetsky wrote: > On August 14, 2003 03:33 pm, Robert Cummings wrote: > > Actually isset() doesn't behave as it should: > > > > $foo = null; > > echo isset( $foo ); > > Not quite. To understand the nature of NULL you must consider the following. > Supp

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread Lars Torben Wilson
On Thu, 2003-08-14 at 08:42, Andi Gutmans wrote: > I am not really convinced either that variable_exists() is > function_exists() parallel. > Under what circumstances is this needed? > > Andi The followup I sent to Ilia gives examples of how this patch can be used to determine whether, for insta

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread Andi Gutmans
I am not really convinced either that variable_exists() is function_exists() parallel. Under what circumstances is this needed? Andi At 03:18 PM 8/14/2003 +0200, [EMAIL PROTECTED] wrote: "Lars Torben Wilson" <[EMAIL PROTECTED]> a écrit dans le message de news:[EMAIL PROTECTED] > Hi out there, >

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread Derick Rethans
On Thu, 14 Aug 2003, walt boring wrote: > Then please explain the logic of why > $var = null > > isset($var) returns false. > > In your words "it will see if a variable is set (has a value)". > > $var IS set and DOES have a value, it just happens to be a value of null. I've done a fair deal of

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread walt boring
Ilia Alshanetsky wrote: On August 14, 2003 03:11 pm, walt boring wrote: exactly why isset() is either 1) a bad name for the function or 2) 'broken' Wrong. isset() has a very proper name "is-set", which to me and other people says that it will see if a variable is set (has a value). It doe

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread Robert Cummings
Actually isset() doesn't behave as it should: $foo = null; echo isset( $foo ); In the above it should return true, but doesn't because it considers null to be not set. Thus it is flawed since I explicitly set it to null. Understandably this is documented; however, the issue here is whethe

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread Ilia Alshanetsky
On August 14, 2003 03:11 pm, walt boring wrote: > exactly why isset() is either > 1) a bad name for the function or > 2) 'broken' Wrong. isset() has a very proper name "is-set", which to me and other people says that it will see if a variable is set (has a value). It does this job admirably and

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread walt boring
Timm Friebe wrote: On Thu, 2003-08-14 at 13:18, [EMAIL PROTECTED] wrote: [...] Hmm, I thought a variable is set even if its value is NULL? Unfortunately it is not: [EMAIL PROTECTED]:~ > php -r '$a= NULL; var_dump(isset($a));' bool(false) - Timm exactly why isset() is either 1) a bad n

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread nicos
- Original Message - From: "Andi Gutmans" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, August 14, 2003 5:42 PM Subject: Re: [PHP-DEV] Re: variable_exists() patch Yes in fact I'm not either. I'm not sure this

Re: [PHP-DEV] Re: variable_exists() patch

2003-08-14 Thread Timm Friebe
On Thu, 2003-08-14 at 13:18, [EMAIL PROTECTED] wrote: [...] > Hmm, I thought a variable is set even if its value is NULL? Unfortunately it is not: [EMAIL PROTECTED]:~ > php -r '$a= NULL; var_dump(isset($a));' bool(false) - Timm -- PHP Internals - PHP Runtime Development Mailing List To unsubs