Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-04 Thread Andi Gutmans

At 08:48 PM 5/3/2001 -0400, David Croft wrote:

In my humble opinion 'null'  is a 'pseudovalue' that has been made
available for some time. If it was never intended for a script to be able
to use it, it should never have been exposed. But it has been and many
people, myself included, are using it.

That's wrong. It was a new value introduced which was meant to be seen (it 
was asked for by Thies). But it was meant to be unset. To be quite honest, 
I don't even quite remember if Zend still uses it for internal values. I 
think it doesn't anymore. I was just saying that forget the Zend internals, 
there is a question of semantics one needs to think of. I must admit I 
haven't had the time to think of this yet in full and I'll think about it 
again.
But although these things always seem trivial to many people you have to 
understand that sometimes the implications can be much more far reaching 
than what you think.
Also no one has gone through all of the modules and check if we are 
consistent with when NULL is returned and when not (returned as an array 
element). It would also help to make a game plan of what to do but I think 
adding key_exists() without being sure of the whole picture is a mistake.
We might end up with the conclusion that this function is the right thing, 
but it has to be a serious conclusion after checking all of the aspects.

Andi

It is particularly useful to mark a value that has not yet been filled.
The same way NULL is used in SQL. If you take out this behaviour there is
no 'pseudo-value' to indicate the absence of value and we will go back to
using 0 or constants, a hack at best.

Also, I see a distinction semantically between isset and key_exists. Isset
asks whether it is set to a tangible value. Key_exists asks whether the
array contains an entry, any entry, for that key.

My 2 cents,
David

--
| /+\ \| | |

David Croft
Infotrek
On Thu, 3 May 2001, Zeev Suraski wrote:

  At 17:20 3/5/2001, Cynic wrote:
  I very much agree with Andrei on this. Please, keep the
  existing functionality.
  
  Although, I'm not familiar with any issues possibly connected
  with this. Does it hurt anything?
 
  Yes, it requires adding of functions that duplicate isset()'s behavior in a
  way that may change in the future (implementation dependent).
 
  Zeev
 
 
  --
  PHP Development Mailing List http://www.php.net/
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-04 Thread Joe Brown

Question:
Is is_null() an alias for isset()?

Based on this statement and my understanding of both funcitons, it should
be.

Andi Gutmans [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 At 07:02 PM 5/3/2001 -0500, Andrei Zmievski wrote:
 At 06:31 PM 5/3/01 -0500, Richard Lynch wrote:
 Um, lots of people use isset($row['foo]) to detect NULL in the
database...
 
 Are you going to change that behaviour?
 
 Don't.
 
 If the column is missing, they screwed up their SQL, which is not within
the
 pervue of PHP to fix in the first place...
 
 You are arguing my point, Richard.

 Andrei,

 Not exactly. No matter if it is set to NULL or unset then isset() will
give
 the same result.
 And most people use isset() AFAIK.
 Andi


 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-04 Thread Zeev Suraski

At 17:30 4/5/2001, Joe Brown wrote:
Question:
Is is_null() an alias for isset()?

Based on this statement and my understanding of both funcitons, it should
be.

No it's not, it's a function.  As such, it cannot detect whether a variable 
exists and has a null value, or is undefined completely.

Zeev


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV]Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-04 Thread Sterling Hughes

On Fri, 4 May 2001, Zeev Suraski wrote:

 At 17:30 4/5/2001, Joe Brown wrote:
 Question:
 Is is_null() an alias for isset()?
 
 Based on this statement and my understanding of both funcitons, it should
 be.

 No it's not, it's a function.  As such, it cannot detect whether a variable
 exists and has a null value, or is undefined completely.


It can if you use it like I have been:

function whatever()
{
$var = NULL;

if (is_null($var)) {
echo variable is null;
}
}

I'm a bit crazy, so I pre-assign a lot of my variables at the top of my
functions (I never could really get used to not pre-declaring
variables)...

-Sterling


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 08:35 AM 5/3/2001 -0500, Andrei Zmievski wrote:
On Thu, 03 May 2001, Zeev Suraski wrote:
  At 13:27 3/5/2001, Jani Taskinen wrote:
  I just want to remind everyone that the 4.0.6 is suppose to have mainly
  bug fixes..or wasn't this agreed on yet?
 
  Yes it was.

Does that mean I should take my array_map() and array_filter() functions
out? ;-)

Nah but I think it means that you shouldn't add any more array_foobar() 
functions before 4.0.7-dev :)

By the way, what happened to that array_defined() or whatever function 
which was added? Didn't we say it should be nuked? isset() and empty() are 
enough IMO especially as NULL is used as undefined.
Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andrei Zmievski

On Thu, 03 May 2001, Andi Gutmans wrote:
 Nah but I think it means that you shouldn't add any more array_foobar() 
 functions before 4.0.7-dev :)

Geez, just when I finished array_foobar()..

 By the way, what happened to that array_defined() or whatever function 
 which was added? Didn't we say it should be nuked? isset() and empty() are 
 enough IMO especially as NULL is used as undefined.

key_exists(), you mean? I didn't put it in, and as far as I know it's
still there.

-Andrei

Windows 2000 is certified not to crash more than
once a day, so what is the bootup time, 24 hours?
-- Sam Liddicott

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 08:45 AM 5/3/2001 -0500, Andrei Zmievski wrote:
On Thu, 03 May 2001, Andi Gutmans wrote:
  Nah but I think it means that you shouldn't add any more array_foobar()
  functions before 4.0.7-dev :)

Geez, just when I finished array_foobar()..

:)

  By the way, what happened to that array_defined() or whatever function
  which was added? Didn't we say it should be nuked? isset() and empty() are
  enough IMO especially as NULL is used as undefined.

key_exists(), you mean? I didn't put it in, and as far as I know it's
still there.

I'd really like to nuke it.

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andrei Zmievski

On Thu, 03 May 2001, Andi Gutmans wrote:
 key_exists(), you mean? I didn't put it in, and as far as I know it's
 still there.
 
 I'd really like to nuke it.

I can sort of see his point really, if $array['foo'] = NULL there is no
way to know whether key 'foo' exists or not..

-Andrei
* Power corrupts. Atomic power corrupts atomically. *

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Zeev Suraski

At 16:46 3/5/2001, Andi Gutmans wrote:
  By the way, what happened to that array_defined() or whatever function
  which was added? Didn't we say it should be nuked? isset() and empty() are
  enough IMO especially as NULL is used as undefined.

key_exists(), you mean? I didn't put it in, and as far as I know it's
still there.

I'd really like to nuke it.

Without commenting on whether it should be nuked or not, there's no way to 
implement this functionality with isset() and empty().  Neither of these 
constructs can be used to figure out whether an element exists and is 
null.  Whether or not this should be detectable is a different issue...

Zeev


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 08:48 AM 5/3/2001 -0500, Andrei Zmievski wrote:
On Thu, 03 May 2001, Andi Gutmans wrote:
  key_exists(), you mean? I didn't put it in, and as far as I know it's
  still there.
 
  I'd really like to nuke it.

I can sort of see his point really, if $array['foo'] = NULL there is no
way to know whether key 'foo' exists or not..

Yeah but I'm afraid it'll make scripts be written on behavior which 
shouldn't be counted on.
Maybe in future versions of Zend $array['foo'] won't be defined. There are 
certain situations where I think it was impossible to not define it so it 
was defined with NULL meaning it's not defined.

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andrei Zmievski

On Thu, 03 May 2001, Andi Gutmans wrote:
 Yeah but I'm afraid it'll make scripts be written on behavior which 
 shouldn't be counted on.
 Maybe in future versions of Zend $array['foo'] won't be defined. There are 
 certain situations where I think it was impossible to not define it so it 
 was defined with NULL meaning it's not defined.

Um, but some db extensions return NULL values as part of the array, so
if column 'foo' is NULL in the db, you'd want the result array to have
NULL under key 'foo' - it just won't do to have that column be missing.

-Andrei
* We reason deeply, when we forcibly feel. *

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 08:53 AM 5/3/2001 -0500, Andrei Zmievski wrote:
On Thu, 03 May 2001, Andi Gutmans wrote:
  Yeah but I'm afraid it'll make scripts be written on behavior which
  shouldn't be counted on.
  Maybe in future versions of Zend $array['foo'] won't be defined. There are
  certain situations where I think it was impossible to not define it so it
  was defined with NULL meaning it's not defined.

Um, but some db extensions return NULL values as part of the array, so
if column 'foo' is NULL in the db, you'd want the result array to have
NULL under key 'foo' - it just won't do to have that column be missing.

Yeah but you can use === NULL for those.
You might be right but I remember we decided it's problematic.

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Cynic

Err, as you say, PHP should make things easy. I don't see how
making tell NULL from an undefined variable makes anything 
easier.


At 15:49 3.5. 2001, Andi Gutmans wrote the following:
-- 
At 08:48 AM 5/3/2001 -0500, Andrei Zmievski wrote:
On Thu, 03 May 2001, Andi Gutmans wrote:
 key_exists(), you mean? I didn't put it in, and as far as I know it's
 still there.

 I'd really like to nuke it.

I can sort of see his point really, if $array['foo'] = NULL there is no
way to know whether key 'foo' exists or not..

Yeah but I'm afraid it'll make scripts be written on behavior which shouldn't be 
counted on.
Maybe in future versions of Zend $array['foo'] won't be defined. There are certain 
situations where I think it was impossible to not define it so it was defined with 
NULL meaning it's not defined.

Andi


-- 
PHP Quality Assurance Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--end of quote-- 


[EMAIL PROTECTED]
-
And the eyes of them both were opened and they saw that their files
were world readable and writable, so they chmoded 600 their files.
- Book of Installation chapt 3 sec 7 


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Zeev Suraski

Hmmm, looks like the MySQL module was changed to add NULL elements to the 
array.  It even looks as if you changed it :)
I intentionally removed the code that populated return values with NULL's, 
to avoid inconsistencies.  People should use the mysql_fetch_field() to 
check which fields there are.
I'd like to change it back...

Zeev

At 16:53 3/5/2001, Andrei Zmievski wrote:
On Thu, 03 May 2001, Andi Gutmans wrote:
  Yeah but I'm afraid it'll make scripts be written on behavior which
  shouldn't be counted on.
  Maybe in future versions of Zend $array['foo'] won't be defined. There are
  certain situations where I think it was impossible to not define it so it
  was defined with NULL meaning it's not defined.

Um, but some db extensions return NULL values as part of the array, so
if column 'foo' is NULL in the db, you'd want the result array to have
NULL under key 'foo' - it just won't do to have that column be missing.

-Andrei
* We reason deeply, when we forcibly feel. *

--
Zeev Suraski [EMAIL PROTECTED]
CTO   co-founder, Zend Technologies Ltd. http://www.zend.com/


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andrei Zmievski

On Thu, 03 May 2001, Zeev Suraski wrote:
 Hmmm, looks like the MySQL module was changed to add NULL elements to the 
 array.  It even looks as if you changed it :)
 I intentionally removed the code that populated return values with NULL's, 
 to avoid inconsistencies.  People should use the mysql_fetch_field() to 
 check which fields there are.
 I'd like to change it back...

Yes, I changed it a while ago because it seems logical that the result
array should be representative of what is in the database. If I run a
query select field1, field2, field3 from table, then I'd better have
all three fields in the result array, rather than hunting for which
field was omitted.

-Andrei


Freedom comes when you learn to let go.
 Creation comes when you learn to say no.
  -madonna 

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Cynic

insert impossible somewhere in the sentence to make it 
make sense.

At 16:04 3.5. 2001, Cynic wrote the following:
-- 
Err, as you say, PHP should make things easy. I don't see how
making tell NULL from an undefined variable makes anything 
easier.


At 15:49 3.5. 2001, Andi Gutmans wrote the following:
-- 
At 08:48 AM 5/3/2001 -0500, Andrei Zmievski wrote:
On Thu, 03 May 2001, Andi Gutmans wrote:
 key_exists(), you mean? I didn't put it in, and as far as I know it's
 still there.

 I'd really like to nuke it.

I can sort of see his point really, if $array['foo'] = NULL there is no
way to know whether key 'foo' exists or not..

Yeah but I'm afraid it'll make scripts be written on behavior which shouldn't be 
counted on.
Maybe in future versions of Zend $array['foo'] won't be defined. There are certain 
situations where I think it was impossible to not define it so it was defined with 
NULL meaning it's not defined.

Andi


-- 
PHP Quality Assurance Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--end of quote-- 


[EMAIL PROTECTED]
-
And the eyes of them both were opened and they saw that their files
were world readable and writable, so they chmoded 600 their files.
- Book of Installation chapt 3 sec 7 


-- 
PHP Quality Assurance Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--end of quote-- 


[EMAIL PROTECTED]
-
And the eyes of them both were opened and they saw that their files
were world readable and writable, so they chmoded 600 their files.
- Book of Installation chapt 3 sec 7 


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Cynic

I very much agree with Andrei on this. Please, keep the 
existing functionality. 

Although, I'm not familiar with any issues possibly connected
with this. Does it hurt anything?


At 16:03 3.5. 2001, Andrei Zmievski wrote the following:
-- 
On Thu, 03 May 2001, Zeev Suraski wrote:
 Hmmm, looks like the MySQL module was changed to add NULL elements to the 
 array.  It even looks as if you changed it :)
 I intentionally removed the code that populated return values with NULL's, 
 to avoid inconsistencies.  People should use the mysql_fetch_field() to 
 check which fields there are.
 I'd like to change it back...

Yes, I changed it a while ago because it seems logical that the result
array should be representative of what is in the database. If I run a
query select field1, field2, field3 from table, then I'd better have
all three fields in the result array, rather than hunting for which
field was omitted.

-Andrei


Freedom comes when you learn to let go.
 Creation comes when you learn to say no.
  -madonna 

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--end of quote-- 


[EMAIL PROTECTED]
-
And the eyes of them both were opened and they saw that their files
were world readable and writable, so they chmoded 600 their files.
- Book of Installation chapt 3 sec 7 


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Zeev Suraski

At 17:20 3/5/2001, Cynic wrote:
I very much agree with Andrei on this. Please, keep the
existing functionality.

Although, I'm not familiar with any issues possibly connected
with this. Does it hurt anything?

Yes, it requires adding of functions that duplicate isset()'s behavior in a 
way that may change in the future (implementation dependent).

Zeev


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andrei Zmievski

On Thu, 03 May 2001, Zeev Suraski wrote:
 Yes, it requires adding of functions that duplicate isset()'s behavior in a 
 way that may change in the future (implementation dependent).

What do you mean? You won't be able to store NULL's in the arrays?

-Andrei
* I don't mind going nowhere as long as it's an interesting path. *

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV]Release process

2001-05-03 Thread Jani Taskinen

On Thu, 3 May 2001, Zeev Suraski wrote:

At 17:20 3/5/2001, Cynic wrote:
I very much agree with Andrei on this. Please, keep the
existing functionality.

Although, I'm not familiar with any issues possibly connected
with this. Does it hurt anything?

Yes, it requires adding of functions that duplicate isset()'s behavior in a
way that may change in the future (implementation dependent).

Could this possible change be delayed to 4.1 ?
As this will definately break A LOT of scripts if it's changed.

--Jani


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 10:43 AM 5/3/2001 -0400, Joe Brown wrote:
What about an isnull() function, opposed to key_exists();

IsPossible()?

Yeah that's definitely a possiblity but then you'd have to do something like.
if (isset($a[foo]) || isnull($a[foo))

Kind of sucky.
But we should think of a good resolution for a major version.

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Zeev Suraski

No plans to do anything at this point.  You can keep all your hairs in tact :)

Zeev

At 17:42 3/5/2001, Jani Taskinen wrote:
On Thu, 3 May 2001, Zeev Suraski wrote:

 At 17:20 3/5/2001, Cynic wrote:
 I very much agree with Andrei on this. Please, keep the
 existing functionality.
 
 Although, I'm not familiar with any issues possibly connected
 with this. Does it hurt anything?
 
 Yes, it requires adding of functions that duplicate isset()'s behavior in a
 way that may change in the future (implementation dependent).

Could this possible change be delayed to 4.1 ?
As this will definately break A LOT of scripts if it's changed.

--Jani

--
Zeev Suraski [EMAIL PROTECTED]
CTO   co-founder, Zend Technologies Ltd. http://www.zend.com/


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Cynic

RTFM :))

http://www.php.net/manual/en/html/function.is-null.html

At 16:47 3.5. 2001, Andi Gutmans wrote the following:
-- 
At 10:43 AM 5/3/2001 -0400, Joe Brown wrote:
What about an isnull() function, opposed to key_exists();

IsPossible()?

Yeah that's definitely a possiblity but then you'd have to do something like.
if (isset($a[foo]) || isnull($a[foo))

Kind of sucky.
But we should think of a good resolution for a major version.

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--end of quote-- 


[EMAIL PROTECTED]
-
And the eyes of them both were opened and they saw that their files
were world readable and writable, so they chmoded 600 their files.
- Book of Installation chapt 3 sec 7 


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV]Release process

2001-05-03 Thread Sterling Hughes

On Thu, 3 May 2001, Andi Gutmans wrote:

 At 10:43 AM 5/3/2001 -0400, Joe Brown wrote:
 What about an isnull() function, opposed to key_exists();
 
 IsPossible()?

 Yeah that's definitely a possiblity but then you'd have to do something like.
 if (isset($a[foo]) || isnull($a[foo))

 Kind of sucky.
 But we should think of a good resolution for a major version.


IsAvailable()

[sterling@localhost standard]$ grep is_null *
basic_functions.c:  PHP_FE(is_null,
first_arg_allow_ref)
basic_functions.c:/* {{{ proto bool is_null(mixed var)
basic_functions.c:PHP_FUNCTION(is_null)
basic_functions.h:PHP_FUNCTION(is_null);
grep: CVS: Is a directory
grep: tests: Is a directory
[sterling@localhost standard]$

I added it in 4.0.4

-Sterling


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

If $a is undefined and you do is_null($a) I supposed you get true.
I was talking about a language construct which will give false in this case.

Anyway, it's not something I think we should change right now.
I think Andrei's MySQL patch should be reverted though. Many people are 
doing isset($row[foo]) on their MySQL query results. Today if foo is 
NULL it will return false. If this is ever changed (some people thing it 
should) it will return true. So why not change the MySQL module back to the 
way it was? It worked for everyone and it might allow us to make this 
change in future.

Andi


At 05:16 PM 5/3/2001 +0200, Cynic wrote:
RTFM :))

http://www.php.net/manual/en/html/function.is-null.html

At 16:47 3.5. 2001, Andi Gutmans wrote the following:
--
 At 10:43 AM 5/3/2001 -0400, Joe Brown wrote:
 What about an isnull() function, opposed to key_exists();
 
 IsPossible()?
 
 Yeah that's definitely a possiblity but then you'd have to do something 
 like.
 if (isset($a[foo]) || isnull($a[foo))
 
 Kind of sucky.
 But we should think of a good resolution for a major version.
 
 Andi
 
 
 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
--end of quote--


[EMAIL PROTECTED]
-
And the eyes of them both were opened and they saw that their files
were world readable and writable, so they chmoded 600 their files.
 - Book of Installation chapt 3 sec 7


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 11:01 PM 5/2/2001 -0400, Sterling Hughes wrote:
IsAvailable()

[sterling@localhost standard]$ grep is_null *
basic_functions.c:  PHP_FE(is_null,
first_arg_allow_ref)
basic_functions.c:/* {{{ proto bool is_null(mixed var)
basic_functions.c:PHP_FUNCTION(is_null)
basic_functions.h:PHP_FUNCTION(is_null);
grep: CVS: Is a directory
grep: tests: Is a directory
[sterling@localhost standard]$

I added it in 4.0.4

See my Email :)

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andrei Zmievski

On Thu, 03 May 2001, Andi Gutmans wrote:
 Anyway, it's not something I think we should change right now.
 I think Andrei's MySQL patch should be reverted though. Many people are 
 doing isset($row[foo]) on their MySQL query results. Today if foo is 
 NULL it will return false. If this is ever changed (some people thing it 
 should) it will return true. So why not change the MySQL module back to the 
 way it was? It worked for everyone and it might allow us to make this 
 change in future.

Ok, why do people do isset($row['foo'])?

Also, have you seen people complain about my patch to MySQL that adds
NULL's to the result set?

-Andrei

Linux is like living in a teepee.
No Windows, no Gates, Apache in house.
- Usenet signature

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 10:17 AM 5/3/2001 -0500, Andrei Zmievski wrote:
On Thu, 03 May 2001, Andi Gutmans wrote:
  Anyway, it's not something I think we should change right now.
  I think Andrei's MySQL patch should be reverted though. Many people are
  doing isset($row[foo]) on their MySQL query results. Today if foo is
  NULL it will return false. If this is ever changed (some people thing it
  should) it will return true. So why not change the MySQL module back to 
 the
  way it was? It worked for everyone and it might allow us to make this
  change in future.

Ok, why do people do isset($row['foo'])?

To see if it's NULL.


Also, have you seen people complain about my patch to MySQL that adds
NULL's to the result set?

No because isset() returns false for NULL values. But many people would 
like it to return true, and then it would break people's scripts. I guess 
at that point we could change the MySQL module back and not really break 
people's scripts.

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Zeev Suraski

At 18:17 3/5/2001, Andrei Zmievski wrote:
Also, have you seen people complain about my patch to MySQL that adds
NULL's to the result set?

Sure.  I just did. :)

Adding an isnull() language construct may be the right way to solve this 
situation;  key_exists() and the today's function is_null() are both 
functions that duplicate language-level functionality, and shouldn't exist 
IMHO.

Zeev


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andrei Zmievski

On Thu, 03 May 2001, Andi Gutmans wrote:
 Also, have you seen people complain about my patch to MySQL that adds
 NULL's to the result set?
 
 No because isset() returns false for NULL values. But many people would 
 like it to return true, and then it would break people's scripts. I guess 
 at that point we could change the MySQL module back and not really break 
 people's scripts.

I have a definite need to know whether $row['foo'] is NULL or not. Can
you propose a solution towards that? If you revert the patch, then the
result set will look as if column 'foo' was never returned.

-Andrei
* Proximity bug: when the program crashes in front of important visitors. *

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andrei Zmievski

On Thu, 03 May 2001, Zeev Suraski wrote:
 Sure.  I just did. :)
 
 Adding an isnull() language construct may be the right way to solve this 
 situation;  key_exists() and the today's function is_null() are both 
 functions that duplicate language-level functionality, and shouldn't exist 
 IMHO.

Why can't language construct be called is_null()? :)

-Andrei
* I wish life had an UNDO function. *

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 10:24 AM 5/3/2001 -0500, Andrei Zmievski wrote:
On Thu, 03 May 2001, Andi Gutmans wrote:
  Also, have you seen people complain about my patch to MySQL that adds
  NULL's to the result set?
 
  No because isset() returns false for NULL values. But many people would
  like it to return true, and then it would break people's scripts. I guess
  at that point we could change the MySQL module back and not really break
  people's scripts.

I have a definite need to know whether $row['foo'] is NULL or not. Can
you propose a solution towards that? If you revert the patch, then the
result set will look as if column 'foo' was never returned.

How do you know today if it's NULL or not?
You can't really tell. It does effect array traversal.
I'm not saying it's right or wrong now. I'm just trying to think ahead 
especially as there are mixed feelings about how NULL should behave.

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Zeev Suraski

At 18:25 3/5/2001, Andrei Zmievski wrote:
On Thu, 03 May 2001, Zeev Suraski wrote:
  Sure.  I just did. :)
 
  Adding an isnull() language construct may be the right way to solve this
  situation;  key_exists() and the today's function is_null() are both
  functions that duplicate language-level functionality, and shouldn't exist
  IMHO.

Why can't language construct be called is_null()? :)

I wasn't talking about the name, only about the fact that it's implemented 
as a function and not as a language construct (i.e., it can't tell the 
difference between existing variables who have the null value, and non 
existing variables).
It's too late to start putting _'s in language constructs, we already have 
isset() as a precedent :)

Zeev


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andrei Zmievski

On Thu, 03 May 2001, Andi Gutmans wrote:
 How do you know today if it's NULL or not?

is_null()?


-Andrei

We all have photographic memories, it's just
that some of us don't have any film.

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 10:38 AM 5/3/2001 -0500, Andrei Zmievski wrote:
On Thu, 03 May 2001, Andi Gutmans wrote:
  How do you know today if it's NULL or not?

is_null()?

is_null() will also return true if it's undefined.

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Joe Brown

is_null() should return false if a variable is not set.

isset() should be used to test for variables existance, not is_null().

This is my opinion and I'm sticking to it.  Those whom deviate from my
opinion are wrong in my opinion!!!

-Joe

Andi Gutmans [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 At 10:38 AM 5/3/2001 -0500, Andrei Zmievski wrote:
 On Thu, 03 May 2001, Andi Gutmans wrote:
   How do you know today if it's NULL or not?
 
 is_null()?

 is_null() will also return true if it's undefined.

 Andi


 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 01:04 PM 5/3/2001 -0400, Joe Brown wrote:
is_null() should return false if a variable is not set.

Well it doesn't. There ya go :)

isset() should be used to test for variables existance, not is_null().

This is my opinion and I'm sticking to it.  Those whom deviate from my
opinion are wrong in my opinion!!!

Yes sir!

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Richard Lynch

 On Thu, 03 May 2001, Andi Gutmans wrote:
  Yeah but I'm afraid it'll make scripts be written on behavior which
  shouldn't be counted on.
  Maybe in future versions of Zend $array['foo'] won't be defined. There
are
  certain situations where I think it was impossible to not define it so
it
  was defined with NULL meaning it's not defined.

 Um, but some db extensions return NULL values as part of the array, so
 if column 'foo' is NULL in the db, you'd want the result array to have
 NULL under key 'foo' - it just won't do to have that column be missing.

Um, lots of people use isset($row['foo]) to detect NULL in the database...

Are you going to change that behaviour?

Don't.

If the column is missing, they screwed up their SQL, which is not within the
pervue of PHP to fix in the first place...

--
WARNING [EMAIL PROTECTED] address is not working -- Use [EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andrei Zmievski

At 06:31 PM 5/3/01 -0500, Richard Lynch wrote:
Um, lots of people use isset($row['foo]) to detect NULL in the database...

Are you going to change that behaviour?

Don't.

If the column is missing, they screwed up their SQL, which is not within the
pervue of PHP to fix in the first place...

You are arguing my point, Richard.

-Andrei


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 07:02 PM 5/3/2001 -0500, Andrei Zmievski wrote:
At 06:31 PM 5/3/01 -0500, Richard Lynch wrote:
Um, lots of people use isset($row['foo]) to detect NULL in the database...

Are you going to change that behaviour?

Don't.

If the column is missing, they screwed up their SQL, which is not within the
pervue of PHP to fix in the first place...

You are arguing my point, Richard.

Andrei,

Not exactly. No matter if it is set to NULL or unset then isset() will give 
the same result.
And most people use isset() AFAIK.
Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andrei Zmievski

At 03:14 AM 5/4/01 +0300, Andi Gutmans wrote:
Not exactly. No matter if it is set to NULL or unset then isset() will 
give the same result.
And most people use isset() AFAIK.

Whatever the current situation, there needs to be a way to check whether a 
certain array entry is NULL or not.

-Andrei


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Release process

2001-05-03 Thread Andi Gutmans

At 07:16 PM 5/3/2001 -0500, Andrei Zmievski wrote:
At 03:14 AM 5/4/01 +0300, Andi Gutmans wrote:
Not exactly. No matter if it is set to NULL or unset then isset() will 
give the same result.
And most people use isset() AFAIK.

Whatever the current situation, there needs to be a way to check whether a 
certain array entry is NULL or not.

If so then we need to make sure that modules like the MySQL module still 
continue to behave exactly like they used to with isset() and other ways 
programmers were working.
I'm not saying you're wrong. It's probably a good idea but we need to think 
about the consequences and other changes we might need to make at the same 
time before breaking stuff.
We should probably save all of the NULL stuff for 4.1.x. If we do it the 
right way we might end up breaking certain scripts.

Andi


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV]Release process

2001-05-03 Thread David Croft


On Thu, 3 May 2001, Andi Gutmans wrote:

 At 08:53 AM 5/3/2001 -0500, Andrei Zmievski wrote:
 Um, but some db extensions return NULL values as part of the array, so
 if column 'foo' is NULL in the db, you'd want the result array to have
 NULL under key 'foo' - it just won't do to have that column be missing.

 Yeah but you can use === NULL for those.
 You might be right but I remember we decided it's problematic.

With all due respect Andi, you can't. There is a difference between a
field being null and that field not existing at all that neither isset,
empty nor === will detect.

david@papaya:~$ php
?
$arr['field'] = null;

$r1 = ($arr['field'] === null);
$r2 = ($arr['blah'] === null);
var_dump($r1);
var_dump($r2);

$r1 = (isset($arr['field']));
$r2 = (isset($arr['blah']));
var_dump($r1);
var_dump($r2);

$r1 = (empty($arr['field']));
$r2 = (empty($arr['blah']));
var_dump($r1);
var_dump($r2);

$r1 = (key_exists('field', $arr));
$r2 = (key_exists('blah', $arr));
var_dump($r1);
var_dump($r2);

?

Out of the four, only key_exists makes the distinction.

I know you had mentioned a problem with Zend not being able to unset
certain fields and instead setting them to null. May I suggest instead
that be attended to - if nothing else, by adding a new 'does not exist'
marker to the bucket that the zend_hash_ functions will recognize.

In the meantime a very large note can be added to the documentation if you
are able to determine exactly what circumstances cause this behaviour.

Cheers,

David

-- 
| /+\ \| | |

David Croft
Infotrek



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV] Re: [PHP-QA] Re: [PHP-DEV]Release process

2001-05-03 Thread David Croft


In my humble opinion 'null'  is a 'pseudovalue' that has been made
available for some time. If it was never intended for a script to be able
to use it, it should never have been exposed. But it has been and many
people, myself included, are using it.

It is particularly useful to mark a value that has not yet been filled.
The same way NULL is used in SQL. If you take out this behaviour there is
no 'pseudo-value' to indicate the absence of value and we will go back to
using 0 or constants, a hack at best.

Also, I see a distinction semantically between isset and key_exists. Isset
asks whether it is set to a tangible value. Key_exists asks whether the
array contains an entry, any entry, for that key.

My 2 cents,
David

-- 
| /+\ \| | |

David Croft
Infotrek
On Thu, 3 May 2001, Zeev Suraski wrote:

 At 17:20 3/5/2001, Cynic wrote:
 I very much agree with Andrei on this. Please, keep the
 existing functionality.
 
 Although, I'm not familiar with any issues possibly connected
 with this. Does it hurt anything?

 Yes, it requires adding of functions that duplicate isset()'s behavior in a
 way that may change in the future (implementation dependent).

 Zeev


 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]