[PHP-DEV] CVS Account Request: umut

2002-11-16 Thread Umut Demirhan
I want to be a part of the translation of php manual page to Turkish project.

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




[PHP-DEV] MySQL ext - News

2002-11-16 Thread nicos
Hello,

While Zak, Georg and Zeev are working on ext/mysql, why not adding a way
to verify if a database and a table exists? like mysql_database_exists() and
mysql_table_exists() ?

It's easy to verify with the table/database list.

Regards
M.CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com Hébergement de sites internets.




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




Re: [PHP-DEV] MySQL ext - News

2002-11-16 Thread Markus Fischer
On Sat, Nov 16, 2002 at 02:08:37PM +0100, [EMAIL PROTECTED] wrote : 
 While Zak, Georg and Zeev are working on ext/mysql, why not adding a way
 to verify if a database and a table exists? like mysql_database_exists() and
 mysql_table_exists() ?
 
 It's easy to verify with the table/database list.

I the past this suggestion came up too. It may remotely even
be that at some point there existed code like that, I don't
know for sure.

The consensus reached was NOT to bloat the MySQL extension
with C code which can be done in a few lines of PHP code.

- Markus

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




[PHP-DEV] Re: MySQL ext - News

2002-11-16 Thread Melvyn Sopacua
On Sat, 16 Nov 2002 [EMAIL PROTECTED] wrote:

 Hello,

 While Zak, Georg and Zeev are working on ext/mysql, why not adding a way
 to verify if a database and a table exists? like mysql_database_exists() and
 mysql_table_exists() ?

What would be the use?

DROP TABLE IF EXISTS
CREATE TABLE IF NOT EXISTS

-- 
Melvyn Sopacua

?php include_once(not_reflecting_employers_views); ?


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




Re: [PHP-DEV] MySQL ext - News

2002-11-16 Thread nicos
Okay I follow you with this point.

--

M.CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com Hébergement de sites internets.

Markus Fischer [EMAIL PROTECTED] a écrit dans le message de
news: [EMAIL PROTECTED]
 On Sat, Nov 16, 2002 at 02:08:37PM +0100, [EMAIL PROTECTED] wrote :
  While Zak, Georg and Zeev are working on ext/mysql, why not adding a
way
  to verify if a database and a table exists? like mysql_database_exists()
and
  mysql_table_exists() ?
 
  It's easy to verify with the table/database list.

 I the past this suggestion came up too. It may remotely even
 be that at some point there existed code like that, I don't
 know for sure.

 The consensus reached was NOT to bloat the MySQL extension
 with C code which can be done in a few lines of PHP code.

 - Markus



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




[PHP-DEV] Re: #19259 [Csd-Ctl]: sort-functions don't work

2002-11-16 Thread Michael Mauch
[EMAIL PROTECTED] wrote:
 ID:   19259
 Updated by:   [EMAIL PROTECTED]
 -Summary:  usort() leaves array unsorted
 Reported By:  [EMAIL PROTECTED]
 -Status:   Closed
 +Status:   Critical
 Bug Type: Arrays related
 -Operating System: OSF1 V4.0 1229
 +Operating System: OSF1 V4.0
 -PHP Version:  4.2.2
 +PHP Version:  4.3.0 RC1
[...]
  EXPECTED OUTPUT
 -- Testing arsort() -- 
 No second argument:
 array(8) {
  [-2147483647]=
  array(2) {
[0]=
string(6) banana
[1]=
string(6) orange
  }
  [test]=
  int(27)
  [2147483647]=
  string(4) test
  [-2147483648]=
  string(6) monkey
[...]
  ACTUAL OUTPUT
 -- Testing arsort() -- 
 No second argument:
 array(8) {
  [-2147483647]=
  array(2) {
[0]=
string(6) banana
[1]=
string(6) orange
  }
  [test]=
  int(27)
  [2147483647]=
  string(4) test
  [2147483648]=
  string(6) monkey

These test results scared me as well, but it looks like this array test
itsself is flawed: it relies on the fact that integers automatically
wrap around to negative values at INT_MAX (=2147483647 on 32 bit
machines). Have a look at the unsorted data in data.inc:

On Linux/Intel (32 bit integers):

# sapi/cli/php -r 'include(ext/standard/tests/array/data.inc); var_dump($data);'
array(8) {
  [0]=
  string(3) PHP
  [17]=
  string(27) PHP: Hypertext Preprocessor
  [5]=
  string(4) Test
  [test]=
  int(27)
  [2147483647]=
  string(4) test
  [-2147483647]=
  array(2) {
[0]=
string(6) banana
[1]=
string(6) orange
  }
  [-2147483648]=
  string(6) monkey
  [16777216]=
  float(-0.33)
}

On Tru64/Alpha (64 bit integers):

# sapi/cli/php -r 'include(ext/standard/tests/array/data.inc); var_dump($data);' 
Unaligned access pid=156100 php va=0x1400510cc pc=0x12019ab50 ra=0x12019ab44 
inst=0xb401
Unaligned access pid=156100 php va=0x14005272c pc=0x12019ab50 ra=0x12019ab44 
inst=0xb401
array(8) {
  [0]=
  string(3) PHP
  [17]=
  string(27) PHP: Hypertext Preprocessor
  [5]=
  string(4) Test
  [test]=
  int(27)
  [2147483647]=
  string(4) test
  [-2147483647]=
  array(2) {
[0]=
string(6) banana
[1]=
string(6) orange
  }
  [2147483648]=
  string(6) monkey
  [16777216]=
  float(-0.33)
}

The difference is in the key of the monkey element: it should be
2147483647+1, but on 32 bit machines, this number is automatically
wrapped and so it results in -2147483648. On 64 bit machines,
2147483647+1 correctly results in +2147483648, so it's impossible to get
the expected result there.

Regards...
Michael

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




[PHP-DEV] Re: #19259 [Csd-Ctl]: sort-functions don't work

2002-11-16 Thread Michael Mauch
I wrote:


These test results scared me as well, but it looks like this array 
test itsself is flawed: it relies on the fact that integers 
automatically wrap around to negative values at INT_MAX (=2147483647 
on 32 bit machines).

Attaching a patch for the array test: I changed the array in data.inc
to have only normal values (1000 and -1000) instead of 2147483647 and
-2147483647, and used the output of the tests on a 32 bit Linux machine 
to be the expected result. With the patch, all three tests PASSed on the 
64 bit Tru64 machine. So array sorting is fortunately not broken again 
on Tru64.

Regards...
		Michael
diff -r -u ../php-cvs/php4/ext/standard/tests/array/001.phpt 
ext/standard/tests/array/001.phpt
--- ../php-cvs/php4/ext/standard/tests/array/001.phpt   Sat Nov  9 11:42:49 2002
+++ ext/standard/tests/array/001.phpt   Sat Nov 16 16:08:01 2002
@@ -57,7 +57,7 @@
   int(27)
   [3]=
   string(4) test
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -113,7 +113,7 @@
 int(27)
 int(3)
 string(4) test
-string(11) -2147483647
+string(5) -1000
 array(2) {
   [0]=
   string(6) banana
diff -r -u ../php-cvs/php4/ext/standard/tests/array/002.phpt 
ext/standard/tests/array/002.phpt
--- ../php-cvs/php4/ext/standard/tests/array/002.phpt   Sat Nov  9 11:42:49 2002
+++ ext/standard/tests/array/002.phpt   Sat Nov 16 16:07:14 2002
@@ -24,16 +24,43 @@
 var_dump ($data);
 }
 
+echo Unsorted data:\n;
+var_dump ($data);
 foreach (array ('arsort', 'asort', 'krsort', 'ksort', 'rsort', 'sort') as 
$test_function) {
 test_sort ($test_function, $data);
 }
 
 ?
 --EXPECT--
--- Testing arsort() -- 
+Unsorted data:
+array(8) {
+  [0]=
+  string(3) PHP
+  [17]=
+  string(27) PHP: Hypertext Preprocessor
+  [5]=
+  string(4) Test
+  [test]=
+  int(27)
+  [1000]=
+  string(4) test
+  [-1000]=
+  array(2) {
+[0]=
+string(6) banana
+[1]=
+string(6) orange
+  }
+  [1001]=
+  string(6) monkey
+  [16777216]=
+  float(-0.33)
+}
+
+ -- Testing arsort() -- 
 No second argument:
 array(8) {
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -42,9 +69,9 @@
   }
   [test]=
   int(27)
-  [2147483647]=
+  [1000]=
   string(4) test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
   [5]=
   string(4) Test
@@ -57,7 +84,7 @@
 }
 Using SORT_REGULAR:
 array(8) {
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -66,9 +93,9 @@
   }
   [test]=
   int(27)
-  [2147483647]=
+  [1000]=
   string(4) test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
   [5]=
   string(4) Test
@@ -83,7 +110,7 @@
 array(8) {
   [test]=
   int(27)
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -94,20 +121,20 @@
   string(3) PHP
   [17]=
   string(27) PHP: Hypertext Preprocessor
-  [-2147483648]=
+  [1001]=
   string(6) monkey
   [5]=
   string(4) Test
-  [2147483647]=
+  [1000]=
   string(4) test
   [16777216]=
   float(-0.33)
 }
 Using SORT_STRING
 array(8) {
-  [2147483647]=
+  [1000]=
   string(4) test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
   [5]=
   string(4) Test
@@ -115,7 +142,7 @@
   string(27) PHP: Hypertext Preprocessor
   [0]=
   string(3) PHP
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -139,13 +166,13 @@
   string(27) PHP: Hypertext Preprocessor
   [5]=
   string(4) Test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
-  [2147483647]=
+  [1000]=
   string(4) test
   [test]=
   int(27)
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -163,13 +190,13 @@
   string(27) PHP: Hypertext Preprocessor
   [5]=
   string(4) Test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
-  [2147483647]=
+  [1000]=
   string(4) test
   [test]=
   int(27)
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -181,9 +208,9 @@
 array(8) {
   [16777216]=
   float(-0.33)
-  [-2147483648]=
+  [1001]=
   string(6) monkey
-  [2147483647]=
+  [1000]=
   string(4) test
   [5]=
   string(4) Test
@@ -191,7 +218,7 @@
   string(27) PHP: Hypertext Preprocessor
   [0]=
   string(3) PHP
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -207,7 +234,7 @@
   float(-0.33)
   [test]=
   int(27)
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -220,19 +247,21 @@
   string(27) PHP: Hypertext Preprocessor
   [5]=
   string(4) Test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
-  [2147483647]=
+  [1000]=
   string(4) test
 }
 
  -- Testing krsort() -- 
 No second argument:
 array(8) {
-  [2147483647]=
-  string(4) test
   [16777216]=
   float(-0.33)
+  [1001]=
+  string(6) monkey
+  [1000]=
+  string(4) test
   [17]=
   string(27) PHP: Hypertext Preprocessor
   [5]=
@@ -241,46 +270,46 @@
   int(27)
   [0]=
   string(3) PHP
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
 [1]=
 string(6) orange
   }
-  

Re: [PHP-DEV] ZEND_ADD_STRING patch

2002-11-16 Thread George Schlossnagle
Hi,

There is a problem with the patch committed.  It incorrectly tokenizes 
things like

$foo = %-{$bar}

(this breaks the PEAR installer, amongst other things)

I've attached a fix for it.

Also, it looks like you didn't accept the part of the fix that allows 
for enhanced handling of heredocs.  Is there a reason why?  I'm 
sticking that in this patch again, in case you merged my last change by 
hand and missed that accidentally.




On Friday, November 15, 2002, at 06:48 PM, George Schlossnagle wrote:


Much sexier indeed.  There are some flaws with it:

o  Tokenizes heredocs on whitespace
o  Doesn't count lines correctly for debug (since strings now have 
newlines in them)

Here's a revised patch to yours that fixes those (heredocs are 
tokenized on newlines - I think that is best case)


Andi Gutmans wrote:

I propose something like the following: (not tested)
It's definitely a sexier patch :)

Andi

RCS file: /repository/ZendEngine2/zend_language_scanner.l,v
retrieving revision 1.62
diff -u -u -r1.62 zend_language_scanner.l
--- zend_language_scanner.l 5 Nov 2002 22:01:35 -   1.62
+++ zend_language_scanner.l 15 Nov 2002 23:22:34 -
@@ -474,6 +474,7 @@
 EXPONENT_DNUM  (({LNUM}|{DNUM})[eE][+-]?{LNUM})
 HNUM   0x[0-9a-fA-F]+
 LABEL  [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*
+ENCAPSED_STRING ([a-zA-Z0-9_\x7f-\xff \t\n\r 
#'.:;,()|^+/*=%!~?@]|-[^])+
 WHITESPACE [ \n\r\t]+
 TABS_AND_SPACES [ \t]*
 TOKENS [;:,.\[\]()|^+-/*=%!~$?@]
@@ -1076,6 +1077,12 @@
return T_VARIABLE;
 }

+ST_DOUBLE_QUOTES,ST_BACKQUOTE{ENCAPSED_STRING} {
+   zendlval-value.str.val = (char *)estrndup(yytext, yyleng);
+   zendlval-value.str.len = yyleng;
+   zendlval-type = IS_STRING;
+   return T_STRING;
+}

 ST_IN_SCRIPTING{LABEL} {
zendlval-value.str.val = (char *)estrndup(yytext, yyleng);
@@ -1085,7 +1092,7 @@
 }


-ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC{LABEL} {
+ST_HEREDOC{LABEL} {
zendlval-value.str.val = (char *)estrndup(yytext, yyleng);
zendlval-value.str.len = yyleng;
zendlval-type = IS_STRING;
@@ -1374,7 +1381,7 @@
 }


-ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC{ESCAPED_AND_WHITESPACE} {
+ST_HEREDOC{ESCAPED_AND_WHITESPACE} {
HANDLE_NEWLINES(yytext, yyleng);
zendlval-value.str.val = (char *) estrndup(yytext, yyleng);
zendlval-value.str.len = yyleng;



Andi




Index: Zend/zend_language_scanner.l
===
RCS file: /repository/Zend/zend_language_scanner.l,v
retrieving revision 1.54
diff -u -3 -r1.54 zend_language_scanner.l
--- Zend/zend_language_scanner.l	13 Nov 2002 03:28:23 -	1.54
+++ Zend/zend_language_scanner.l	15 Nov 2002 23:47:29 -
@@ -95,7 +95,7 @@
 \
 	while (pboundary) {		\
 		if (*p == '\n') {		\
-			CG(zend_lineno)++;	\
+		CG(zend_lineno)++;	\
 		} else if ((*p == '\r')  (p+1  boundary)  (*(p+1) != '\n')) 
{		\
 			CG(zend_lineno)++;	\
 		}		\
@@ -707,6 +707,8 @@
 EXPONENT_DNUM	(({LNUM}|{DNUM})[eE][+-]?{LNUM})
 HNUM	0x[0-9a-fA-F]+
 LABEL	[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*
+ENCAPSED_STRING ([a-zA-Z0-9_\x7f-\xff \t 
#'.:;,()|^+/*=%!~?@]|-[^])+
+ENCAPSED_STRING_WITH_NEWLINE ([a-zA-Z0-9_\x7f-\xff \t\n\r 
#'.:;,()|^+/*=%!~?@]|-[^])+
 WHITESPACE [ \n\r\t]+
 TABS_AND_SPACES [ \t]*
 TOKENS [;:,.\[\]()|^+-/*=%!~$?@]
@@ -1287,6 +1289,13 @@
 	return T_VARIABLE;
 }

+ST_DOUBLE_QUOTES,ST_BACKQUOTE{ENCAPSED_STRING_WITH_NEWLINE} {
+   HANDLE_NEWLINES(yytext, yyleng);
+   zendlval-value.str.val = (char *)estrndup(yytext, yyleng);
+   zendlval-value.str.len = yyleng;
+   zendlval-type = IS_STRING;
+   return T_STRING;
+}

 ST_IN_SCRIPTING{LABEL} {
  	zend_copy_value(zendlval, yytext, yyleng);
@@ -1295,7 +1304,7 @@
 }


-ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC{LABEL} {
+ST_HEREDOC{ENCAPSED_STRING} {
  	zend_copy_value(zendlval, yytext, yyleng);
 	zendlval-type = IS_STRING;
 	return T_STRING;
@@ -1598,7 +1607,7 @@
 }


-ST_DOUBLE_QUOTES,ST_BACKQUOTE,ST_HEREDOC{ESCAPED_AND_WHITESPACE} {
+ST_HEREDOC{ESCAPED_AND_WHITESPACE} {
 	HANDLE_NEWLINES(yytext, yyleng);
 	zendlval-value.str.val = (char *) estrndup(yytext, yyleng);
 	zendlval-value.str.len = yyleng;

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


[PHP-DEV] account update request

2002-11-16 Thread Sebastian Nohn
could someone please give me (nohn) php4 karma?


Regards,
   Sebastian Nohn
-- 
[EMAIL PROTECTED] - http://www.nohn.net/
PGP Key Available - Did I help you? Consider a gift:
http://www.amazon.de/exec/obidos/wishlist/3HYH6NR8ZI0WI/

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




RE: [PHP-DEV] Re: #19259 [Csd-Ctl]: sort-functions don't work

2002-11-16 Thread Sebastian Nohn
 -Original Message-
 From: Michael Mauch [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, November 16, 2002 4:29 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DEV] Re: #19259 [Csd-Ctl]: sort-functions don't work
 
 
 I wrote:
 
  These test results scared me as well, but it looks like this array 
  test itsself is flawed: it relies on the fact that integers 
  automatically wrap around to negative values at INT_MAX (=2147483647 
  on 32 bit machines).
 
 Attaching a patch for the array test: I changed the array in data.inc
 to have only normal values (1000 and -1000) instead of 2147483647 and
 -2147483647, and used the output of the tests on a 32 bit Linux machine 
 to be the expected result. With the patch, all three tests PASSed on the 
 64 bit Tru64 machine. So array sorting is fortunately not broken again 
 on Tru64.

Great! It would be nice if someone with enough karma apply this patch.

Regards,
   Sebastian Nohn
-- 
[EMAIL PROTECTED] - http://www.nohn.net/
PGP Key Available - Did I help you? Consider a gift:
http://www.amazon.de/exec/obidos/wishlist/3HYH6NR8ZI0WI/

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




Re: [PHP-DEV] ZEND_ADD_STRING patch

2002-11-16 Thread Andi Gutmans
At 11:35 AM 11/16/2002 -0500, George Schlossnagle wrote:

Hi,

There is a problem with the patch committed.  It incorrectly tokenizes 
things like

$foo = %-{$bar}

(this breaks the PEAR installer, amongst other things)

I've attached a fix for it.

Also, it looks like you didn't accept the part of the fix that allows for 
enhanced handling of heredocs.  Is there a reason why?  I'm sticking that 
in this patch again, in case you merged my last change by hand and missed 
that accidentally.

Yeah I merged by hand (because of whitespace problems as you don't attach 
patches).
Please send the me required patch vs. the current CVS.

Thanks,

Andi


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



Re: [PHP-DEV] Re: #19259 [Csd-Ctl]: sort-functions don't work

2002-11-16 Thread Marcus Börger
Thanks it looks good - applied.

marcus

At 16:29 16.11.2002, Michael Mauch wrote:

I wrote:


These test results scared me as well, but it looks like this array test 
itsself is flawed: it relies on the fact that integers automatically wrap 
around to negative values at INT_MAX (=2147483647 on 32 bit machines).

Attaching a patch for the array test: I changed the array in data.inc
to have only normal values (1000 and -1000) instead of 2147483647 and
-2147483647, and used the output of the tests on a 32 bit Linux machine to 
be the expected result. With the patch, all three tests PASSed on the 64 
bit Tru64 machine. So array sorting is fortunately not broken again on Tru64.

Regards...
Michael


diff -r -u ../php-cvs/php4/ext/standard/tests/array/001.phpt 
ext/standard/tests/array/001.phpt
--- ../php-cvs/php4/ext/standard/tests/array/001.phpt   Sat Nov  9 
11:42:49 2002
+++ ext/standard/tests/array/001.phpt   Sat Nov 16 16:08:01 2002
@@ -57,7 +57,7 @@
   int(27)
   [3]=
   string(4) test
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -113,7 +113,7 @@
 int(27)
 int(3)
 string(4) test
-string(11) -2147483647
+string(5) -1000
 array(2) {
   [0]=
   string(6) banana
diff -r -u ../php-cvs/php4/ext/standard/tests/array/002.phpt 
ext/standard/tests/array/002.phpt
--- ../php-cvs/php4/ext/standard/tests/array/002.phpt   Sat Nov  9 
11:42:49 2002
+++ ext/standard/tests/array/002.phpt   Sat Nov 16 16:07:14 2002
@@ -24,16 +24,43 @@
 var_dump ($data);
 }

+echo Unsorted data:\n;
+var_dump ($data);
 foreach (array ('arsort', 'asort', 'krsort', 'ksort', 'rsort', 'sort') 
as $test_function) {
 test_sort ($test_function, $data);
 }

 ?
 --EXPECT--
--- Testing arsort() --
+Unsorted data:
+array(8) {
+  [0]=
+  string(3) PHP
+  [17]=
+  string(27) PHP: Hypertext Preprocessor
+  [5]=
+  string(4) Test
+  [test]=
+  int(27)
+  [1000]=
+  string(4) test
+  [-1000]=
+  array(2) {
+[0]=
+string(6) banana
+[1]=
+string(6) orange
+  }
+  [1001]=
+  string(6) monkey
+  [16777216]=
+  float(-0.33)
+}
+
+ -- Testing arsort() --
 No second argument:
 array(8) {
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -42,9 +69,9 @@
   }
   [test]=
   int(27)
-  [2147483647]=
+  [1000]=
   string(4) test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
   [5]=
   string(4) Test
@@ -57,7 +84,7 @@
 }
 Using SORT_REGULAR:
 array(8) {
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -66,9 +93,9 @@
   }
   [test]=
   int(27)
-  [2147483647]=
+  [1000]=
   string(4) test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
   [5]=
   string(4) Test
@@ -83,7 +110,7 @@
 array(8) {
   [test]=
   int(27)
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -94,20 +121,20 @@
   string(3) PHP
   [17]=
   string(27) PHP: Hypertext Preprocessor
-  [-2147483648]=
+  [1001]=
   string(6) monkey
   [5]=
   string(4) Test
-  [2147483647]=
+  [1000]=
   string(4) test
   [16777216]=
   float(-0.33)
 }
 Using SORT_STRING
 array(8) {
-  [2147483647]=
+  [1000]=
   string(4) test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
   [5]=
   string(4) Test
@@ -115,7 +142,7 @@
   string(27) PHP: Hypertext Preprocessor
   [0]=
   string(3) PHP
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -139,13 +166,13 @@
   string(27) PHP: Hypertext Preprocessor
   [5]=
   string(4) Test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
-  [2147483647]=
+  [1000]=
   string(4) test
   [test]=
   int(27)
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -163,13 +190,13 @@
   string(27) PHP: Hypertext Preprocessor
   [5]=
   string(4) Test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
-  [2147483647]=
+  [1000]=
   string(4) test
   [test]=
   int(27)
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -181,9 +208,9 @@
 array(8) {
   [16777216]=
   float(-0.33)
-  [-2147483648]=
+  [1001]=
   string(6) monkey
-  [2147483647]=
+  [1000]=
   string(4) test
   [5]=
   string(4) Test
@@ -191,7 +218,7 @@
   string(27) PHP: Hypertext Preprocessor
   [0]=
   string(3) PHP
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -207,7 +234,7 @@
   float(-0.33)
   [test]=
   int(27)
-  [-2147483647]=
+  [-1000]=
   array(2) {
 [0]=
 string(6) banana
@@ -220,19 +247,21 @@
   string(27) PHP: Hypertext Preprocessor
   [5]=
   string(4) Test
-  [-2147483648]=
+  [1001]=
   string(6) monkey
-  [2147483647]=
+  [1000]=
   string(4) test
 }

  -- Testing krsort() --
 No second argument:
 array(8) {
-  [2147483647]=
-  string(4) test
   [16777216]=
   float(-0.33)
+  [1001]=
+  string(6) monkey
+  [1000]=
+  string(4) test
   [17]=
   string(27) PHP: Hypertext Preprocessor
   [5]=
@@ -241,46 +270,46 @@
   int(27)
   [0]=
   string(3) PHP
-  [-2147483647]=
+  [-1000]=
   

Re: [PHP-DEV] Re: #19259 [Csd-Ctl]: sort-functions don't work

2002-11-16 Thread Michael Mauch
Marcus Börger [EMAIL PROTECTED] wrote:
 Thanks it looks good - applied.

Thanks, great.

While we're at it, there's another test which fails on 64 bit machines
and can easily be fixed:

var_dump float test [ext/standard/tests/general_functions/008.phpt]

This test fails because 123456789012 and 1234567890120 are PHP integers
on 64 bit machines:

 EXPECTED OUTPUT
[...]
  [11]=
  float(123456789012)
  [12]=
  float(1234567890120)
 ACTUAL OUTPUT
[...]
  [11]=
  int(123456789012)
  [12]=
  int(1234567890123)

The fix:

--- ext/standard/tests/general_functions/008.phpt~  Wed Aug 21 03:27:56 2002
+++ ext/standard/tests/general_functions/008.phpt   Sun Nov 10 22:50:29 2002
@@ -5,7 +5,7 @@
 --FILE--
 ?php
 // this checks f,g,G conversion for snprintf/spprintf
-var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012,1234567890123,12345678901234567890));
+var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012,(float)1234567890123,(float)12345678901234567890));
 ?
 --EXPECT--
 array(14) {

Regards...
Michael

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




[PHP-DEV] Aggregation ZE2 fix

2002-11-16 Thread Marcus Börger
With the following patch aggregation works for me with ZE1 and ZE2,
php 4.3.0 and php4.4-dev. If noone objects i will commit this.

marcus

cvs -z3 -q diff aggregation.c (in directory S:\php4-HEAD\ext\standard)
Index: aggregation.c
===
RCS file: /repository/php4/ext/standard/aggregation.c,v
retrieving revision 1.11
diff -u -r1.11 aggregation.c
--- aggregation.c   24 Aug 2002 01:19:27 -  1.11
+++ aggregation.c   16 Nov 2002 19:22:49 -
@@ -27,20 +27,11 @@

 static void aggregation_info_dtor(aggregation_info *info)
 {
-   /* FIXME: This is here to make it compile with Engine 2 but part of 
this module will need rewriting */
-
 #ifndef ZEND_ENGINE_2
destroy_zend_class(info-new_ce);
efree(info-new_ce);
 #else
-   /* FIXME: In ZE2, there seems to be an issue with refcounts or 
something between
-* this class entry and the original; there are problems when 
destroying the
-* function table.
-* Skipping deleting here will prevent a segfault but will leak
-* the class name, the static_members hash and the ce itself.
-* */
-
-   /* destroy_zend_class(info-new_ce); */
+   destroy_zend_class(info-new_ce);
 #endif
zval_ptr_dtor(info-aggr_members);

@@ -393,6 +384,9 @@

zend_hash_init(new_ce-private_properties, 10, NULL, 
ZVAL_PTR_DTOR, 0);
zend_hash_copy(new_ce-private_properties, 
Z_OBJCE_P(obj)-private_properties, (copy_ctor_func_t) zval_add_ref, (void 
*) tmp, sizeof(zval *));
+
+   zend_hash_init(new_ce-protected_properties, 10, NULL, 
ZVAL_PTR_DTOR, 0);
+   zend_hash_copy(new_ce-protected_properties, 
Z_OBJCE_P(obj)-protected_properties, (copy_ctor_func_t) zval_add_ref, 
(void *) tmp, sizeof(zval *));

new_ce-constructor = Z_OBJCE_P(obj)-constructor;
new_ce-destructor = Z_OBJCE_P(obj)-destructor;




Re: [PHP-DEV] Re: #19259 [Csd-Ctl]: sort-functions don't work

2002-11-16 Thread Marcus Börger
Could you try the following patch instead?

cvs -z3 -q diff 008.phpt (in directory 
S:\php4-HEAD\ext\standard\tests\general_functions)
Index: 008.phpt
===
RCS file: /repository/php4/ext/standard/tests/general_functions/008.phpt,v
retrieving revision 1.1
diff -u -r1.1 008.phpt
--- 008.phpt21 Aug 2002 01:27:56 -  1.1
+++ 008.phpt16 Nov 2002 19:29:06 -
@@ -5,7 +5,7 @@
 --FILE--
 ?php
 // this checks f,g,G conversion for snprintf/spprintf
-var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012,1234567890123,12345678901234567890));
+var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012.0,1234567890123.0,12345678901234567890));
 ?
 --EXPECT--
 array(14) {



At 20:17 16.11.2002, Michael Mauch wrote:
Marcus Börger [EMAIL PROTECTED] wrote:
 Thanks it looks good - applied.

Thanks, great.

While we're at it, there's another test which fails on 64 bit machines
and can easily be fixed:

var_dump float test [ext/standard/tests/general_functions/008.phpt]

This test fails because 123456789012 and 1234567890120 are PHP integers
on 64 bit machines:

 EXPECTED OUTPUT
[...]
  [11]=
  float(123456789012)
  [12]=
  float(1234567890120)
 ACTUAL OUTPUT
[...]
  [11]=
  int(123456789012)
  [12]=
  int(1234567890123)

The fix:

--- ext/standard/tests/general_functions/008.phpt~  Wed Aug 21 
03:27:56 2002
+++ ext/standard/tests/general_functions/008.phpt   Sun Nov 10 
22:50:29 2002
@@ -5,7 +5,7 @@
 --FILE--
 ?php
 // this checks f,g,G conversion for snprintf/spprintf
-var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012,1234567890123,12345678901234567890));
+var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012,(float)1234567890123,(float)12345678901234567890));
 ?
 --EXPECT--
 array(14) {

Regards...
Michael

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


Re: [PHP-DEV] Re: #19259 [Csd-Ctl]: sort-functions don't work

2002-11-16 Thread Marcus Börger
Ups one missing:
cvs -z3 -q diff 008.phpt (in directory 
S:\php4-HEAD\ext\standard\tests\general_functions\)
Index: 008.phpt
===
RCS file: /repository/php4/ext/standard/tests/general_functions/008.phpt,v
retrieving revision 1.1
diff -u -r1.1 008.phpt
--- 008.phpt21 Aug 2002 01:27:56 -  1.1
+++ 008.phpt16 Nov 2002 19:31:34 -
@@ -5,7 +5,7 @@
 --FILE--
 ?php
 // this checks f,g,G conversion for snprintf/spprintf
-var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012,1234567890123,12345678901234567890));
+var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012.0,1234567890123.0,12345678901234567890.0));
 ?
 --EXPECT--
 array(14) {



At 20:29 16.11.2002, Marcus Börger wrote:
Could you try the following patch instead?

cvs -z3 -q diff 008.phpt (in directory 
S:\php4-HEAD\ext\standard\tests\general_functions)
Index: 008.phpt
===
RCS file: /repository/php4/ext/standard/tests/general_functions/008.phpt,v
retrieving revision 1.1
diff -u -r1.1 008.phpt
--- 008.phpt21 Aug 2002 01:27:56 -  1.1
+++ 008.phpt16 Nov 2002 19:29:06 -
@@ -5,7 +5,7 @@
 --FILE--
 ?php
 // this checks f,g,G conversion for snprintf/spprintf
-var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012,1234567890123,12345678901234567890));
+var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012.0,1234567890123.0,12345678901234567890));
 ?
 --EXPECT--
 array(14) {



At 20:17 16.11.2002, Michael Mauch wrote:
Marcus Börger [EMAIL PROTECTED] wrote:
 Thanks it looks good - applied.

Thanks, great.

While we're at it, there's another test which fails on 64 bit machines
and can easily be fixed:

var_dump float test [ext/standard/tests/general_functions/008.phpt]

This test fails because 123456789012 and 1234567890120 are PHP integers
on 64 bit machines:

 EXPECTED OUTPUT
[...]
  [11]=
  float(123456789012)
  [12]=
  float(1234567890120)
 ACTUAL OUTPUT
[...]
  [11]=
  int(123456789012)
  [12]=
  int(1234567890123)

The fix:

--- ext/standard/tests/general_functions/008.phpt~  Wed Aug 21 
03:27:56 2002
+++ ext/standard/tests/general_functions/008.phpt   Sun Nov 10 
22:50:29 2002
@@ -5,7 +5,7 @@
 --FILE--
 ?php
 // this checks f,g,G conversion for snprintf/spprintf
-var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012,1234567890123,12345678901234567890));
+var_dump(array(ini_get('precision'),.012,-.012,.12,-.12,1.2,-1.2,12.,-12.,0.000123,.123,123456789012,(float)1234567890123,(float)12345678901234567890));
 ?
 --EXPECT--
 array(14) {

Regards...
Michael

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


[PHP-DEV] Re: : sort-functions don't work

2002-11-16 Thread Michael Mauch
Marcus Börger wrote:

 Ups one missing:
 cvs -z3 -q diff 008.phpt (in directory 
 S:\php4-HEAD\ext\standard\tests\general_functions\)
 Index: 008.phpt
 ===
 RCS file: /repository/php4/ext/standard/tests/general_functions/008.phpt,v
 retrieving revision 1.1
 diff -u -r1.1 008.phpt
 --- 008.phpt21 Aug 2002 01:27:56 -  1.1
 +++ 008.phpt16 Nov 2002 19:31:34 -

Yes, this works!

Regards...
Michael

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




[PHP-DEV] [PATCH]s New Function getanyrr() proposal

2002-11-16 Thread Pollita
The three attached patch files (to be applied in ext/standard/ ) introduce
a new function: getanyrr().  Where the existing getmxrr() will retrieve MX
records for a given host, getanyrr() will return all standard INET DNS
Resource Records.

proto:
  array getanyrr(string hostname [, string type[, array authns, array
addtl]])

Type is optional and can be any of ANY, A, MX, CNAME, NS,
TXT, SOA, HINFO, or PTR.  ANY is default.

getanyrr returns an index array of associative arrays.  Each associative
array contains 'host', 'type', 'class', 'ttl', and one or more additional
records depending on type.

The third and fourth arguments are pass-by-ref arrays with the same
structure as the function return argument.  authns contains a list of
authoritative name servers, while addtl contains additional relevant
records (typically A records for the name servers).

Further documentation to be submitted to PHP-DOC when and if attached
patches are accepted and committed to CVS.

basic_functions.cPatch against r1.543
dns.cPatch against r1.44
dns.hPatch against r1.11


--- basic_functions.c   Sat Nov 16 13:35:31 2002
+++ basic_functions.c   Sat Nov 16 13:41:53 2002
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.543 2002/11/08 15:49:32 sterling Exp $ */
+/* $Id: basic_functions.c,v 1.543 2002/11/16 13:18:21 pollita Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -440,6 +440,7 @@
 
 #if HAVE_RES_SEARCH  !(defined(__BEOS__) || defined(PHP_WIN32) || defined(NETWARE))
PHP_FE(checkdnsrr, 
 NULL)
+PHP_FE(getanyrr,third_and_rest_force_ref)
PHP_FE(getmxrr,second_and_third_args_force_ref)
 #endif
 
--- dns.h   Sat Nov 16 13:33:06 2002
+++ dns.h   Sat Nov 16 13:38:33 2002
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: dns.h,v 1.11 2002/02/28 08:26:44 sebastian Exp $ */
+/* $Id: dns.h,v 1.12 2002/11/16 13:38:33 pollita Exp $ */
 
 #ifndef DNS_H
 #define DNS_H
@@ -27,7 +27,14 @@
 
 #if HAVE_RES_SEARCH  !(defined(__BEOS__)||defined(PHP_WIN32))
 PHP_FUNCTION(checkdnsrr);
+PHP_FUNCTION(getanyrr);
 PHP_FUNCTION(getmxrr);
+
+typedef union {
+HEADER qb1;
+u_char qb2[65536];
+} querybuf;
+
 #endif
 
 #ifndef INT16SZ
--- dns.c   Sat Nov 16 13:31:51 2002
+++ dns.c   Sat Nov 16 13:45:25 2002
@@ -277,6 +277,244 @@
 #define MAXHOSTNAMELEN  256
 #endif /* MAXHOSTNAMELEN */
 
+#ifndef MAXRESOURCERECORDS
+#define MAXRESOURCERECORDS 64
+#endif /* MAXRESOURCERECORDS */
+
+/* {{{ php_parserr
+ */
+u_char *php_parserr(u_char *cp, querybuf *answer, int typeToFetch, zval **subarray) {
+   u_short type,class,dlen;
+   u_long ttl;
+   long n,i;
+   char name[MAXHOSTNAMELEN];
+
+   n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof name) - 2);
+   if (n  0) {
+   return NULL;
+   }
+   cp += n;
+
+   GETSHORT(type,cp);
+   GETSHORT(class,cp);
+   GETLONG(ttl,cp);
+   GETSHORT(dlen,cp);
+   if (typeToFetch != T_ANY  type != typeToFetch) {
+   /* Should never actually occour */
+   cp += dlen;
+   return NULL;
+   }
+
+   MAKE_STD_ZVAL(*subarray);
+   if (array_init(*subarray) != SUCCESS) {
+   return NULL;
+   }
+   add_assoc_string(*subarray,host,name,1);
+
+   switch (type) {
+   case T_A:
+   add_assoc_string(*subarray,type,A,1);
+   sprintf(name,%d.%d.%d.%d,cp[0],cp[1],cp[2],cp[3]);
+   add_assoc_string(*subarray,ip,name,1);
+   cp += dlen;
+   break;
+   case T_MX:
+   add_assoc_string(*subarray,type,MX,1);
+   GETSHORT(n,cp);
+   add_assoc_long(*subarray,pri,n);
+   case T_CNAME:
+   if (type == T_CNAME)
+   add_assoc_string(*subarray,type,CNAME,1);
+   case T_NS:
+   if (type == T_NS)
+   add_assoc_string(*subarray,type,NS,1);
+   case T_PTR:
+   if (type == T_PTR)
+   add_assoc_string(*subarray,type,PTR,1);
+   n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof 
+name) - 2);
+   if (n0) {
+   return NULL;
+   }
+   cp += n;
+   add_assoc_string(*subarray,target,name,1);
+   break;
+   case T_HINFO:
+   /* See RFC 1010 for values */
+   GETSHORT(n,cp);
+   add_assoc_long(*subarray,cpu,n);
+ 

[PHP-DEV] ext/standard/tests/math/log.phpt coredump on Tru64

2002-11-16 Thread Michael Mauch
Hi,

php4-STABLE-200211152030 dumps core on Tru64/Alpha with
ext/standard/tests/math/log.phpt:

 EXPECTED OUTPUT
On failure, please mail result to [EMAIL PROTECTED]
200
50
50
50
50
50
50
50
50
50
 ACTUAL OUTPUT
On failure, please mail result to [EMAIL PROTECTED]
200
 FAILED

Looking which values it doesn't like:

# sapi/cli/php -r 'echo log(0, 2),\n;'
Floating point exception (core dumped)
# sapi/cli/php -r 'echo log(0, 3),\n;'
-1.6363308087894E+308
# sapi/cli/php -r 'echo log(0, 10),\n;'
-7.8072820862606E+307
# sapi/cli/php -r 'echo log(0, 1),\n;'
Floating point exception (core dumped)
# sapi/cli/php -r 'echo log(0),\n;'
-1.7976931348623E+308

Regards...
Michael

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




[PHP-DEV] Re: [PATCH]s New Function getanyrr() proposal

2002-11-16 Thread nicos
Hello all,

After having reviewed this one, I saw few changes to do, I asked Pollita
and he did them. He is sending a new patch and I vote +1 for it.

Regards.
M.CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com Hébergement de sites internets.

Pollita [EMAIL PROTECTED] a écrit dans le message de news:
[EMAIL PROTECTED]
 The three attached patch files (to be applied in ext/standard/ ) introduce
 a new function: getanyrr().  Where the existing getmxrr() will retrieve MX
 records for a given host, getanyrr() will return all standard INET DNS
 Resource Records.

 proto:
   array getanyrr(string hostname [, string type[, array authns, array
 addtl]])

 Type is optional and can be any of ANY, A, MX, CNAME, NS,
 TXT, SOA, HINFO, or PTR.  ANY is default.

 getanyrr returns an index array of associative arrays.  Each associative
 array contains 'host', 'type', 'class', 'ttl', and one or more additional
 records depending on type.

 The third and fourth arguments are pass-by-ref arrays with the same
 structure as the function return argument.  authns contains a list of
 authoritative name servers, while addtl contains additional relevant
 records (typically A records for the name servers).

 Further documentation to be submitted to PHP-DOC when and if attached
 patches are accepted and committed to CVS.

 basic_functions.cPatch against r1.543
 dns.cPatch against r1.44
 dns.hPatch against r1.11





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




[PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition

2002-11-16 Thread Pollita
Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to
ext/standard/dns.c for addition of getanyrr() function.


--- dns.c   Sat Nov 16 13:31:51 2002
+++ dns.c   Sat Nov 16 15:04:07 2002
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.44 2002/10/18 22:08:23 sniper Exp $ */
+/* $Id: dns.c,v 1.44 2002/11/16 14:51:58 pollita Exp $ */
 
 /* {{{ includes
  */
@@ -276,6 +276,252 @@
 #ifndef MAXHOSTNAMELEN
 #define MAXHOSTNAMELEN  256
 #endif /* MAXHOSTNAMELEN */
+
+#ifndef MAXRESOURCERECORDS
+#define MAXRESOURCERECORDS 64
+#endif /* MAXRESOURCERECORDS */
+
+/* {{{ php_parserr
+ */
+u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, zval **subarray) 
+{
+   u_short type, class, dlen;
+   u_long ttl;
+   long n, i;
+   char name[MAXHOSTNAMELEN];
+
+   n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof name) - 2);
+   if (n  0) {
+   return NULL;
+   }
+   cp += n;
+
+   GETSHORT(type,cp);
+   GETSHORT(class,cp);
+   GETLONG(ttl,cp);
+   GETSHORT(dlen,cp);
+   if (type_to_fetch != T_ANY  type != type_to_fetch) {
+   /* Should never actually occour */
+   cp += dlen;
+   return NULL;
+   }
+
+   MAKE_STD_ZVAL(*subarray);
+   if (array_init(*subarray) != SUCCESS) {
+   return NULL;
+   }
+   add_assoc_string(*subarray,host,name,1);
+
+   switch (type) {
+   case T_A:
+   add_assoc_string(*subarray,type,A,1);
+   sprintf(name,%d.%d.%d.%d,cp[0],cp[1],cp[2],cp[3]);
+   add_assoc_string(*subarray,ip,name,1);
+   cp += dlen;
+   break;
+   case T_MX:
+   add_assoc_string(*subarray,type,MX,1);
+   GETSHORT(n,cp);
+   add_assoc_long(*subarray,pri,n);
+   case T_CNAME:
+   if (type == T_CNAME)
+   add_assoc_string(*subarray,type,CNAME,1);
+   case T_NS:
+   if (type == T_NS)
+   add_assoc_string(*subarray,type,NS,1);
+   case T_PTR:
+   if (type == T_PTR)
+   add_assoc_string(*subarray,type,PTR,1);
+   n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof 
+name) - 2);
+   if (n  0) {
+   return NULL;
+   }
+   cp += n;
+   add_assoc_string(*subarray,target,name,1);
+   break;
+   case T_HINFO:
+   /* See RFC 1010 for values */
+   GETSHORT(n,cp);
+   add_assoc_long(*subarray,cpu,n);
+   GETSHORT(n,cp);
+   add_assoc_long(*subarray,os,n);
+   break;
+   case T_TXT:
+   add_assoc_string(*subarray,type,TXT,1);
+   n = cp[0];
+   for(i=1; i=n; i++)
+   name[i-1] = cp[i];
+   name[i-1] = '\0';
+   cp += dlen;
+   add_assoc_string(*subarray,txt,name,1);
+   break;
+   case T_SOA:
+   add_assoc_string(*subarray,type,SOA,1);
+   n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof 
+name) -2);
+   if (n  0) {
+   return NULL;
+   }
+   cp += n;
+   add_assoc_string(*subarray,mname,name,1);
+   n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof 
+name) -2);
+   if (n  0) {
+   return NULL;
+   }
+   cp += n;
+   add_assoc_string(*subarray,rname,name,1);
+   GETLONG(n,cp);
+   add_assoc_long(*subarray,serial,n);
+   GETLONG(n,cp);
+   add_assoc_long(*subarray,refresh,n);
+   GETLONG(n,cp);
+   add_assoc_long(*subarray,retry,n);
+   GETLONG(n,cp);
+   add_assoc_long(*subarray,expire,n);
+   GETLONG(n,cp);
+   add_assoc_long(*subarray,minimum-ttl,n);
+   break;
+   default:
+   cp += dlen;
+   }
+
+   add_assoc_string(*subarray,class,IN,1);
+   add_assoc_long(*subarray,ttl,ttl);
+
+   return cp;
+}
+/* }}} */
+
+/* {{{ proto array getanyrr(string hostname [, string type[, array authns, array 

[PHP-DEV] Re: [PATH] update to earlier proposed patch for getanyrr() function addition

2002-11-16 Thread nicos
Hello,

You should definitly add RETURN_TRUE; at the end of the PHP_FUNCTION().

Regards.
M.CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com Hébergement de sites internets.

Pollita [EMAIL PROTECTED] a écrit dans le message de news:
[EMAIL PROTECTED]
 Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to
 ext/standard/dns.c for addition of getanyrr() function.





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




Re: [PHP-DEV] ZEND_ADD_STRING patch

2002-11-16 Thread George Schlossnagle
Here's the patch.  Looks like everything but the heredoc part is in cvs 
now.






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


Re: [PHP-DEV] Re: [PATCH]s New Function getanyrr() proposal

2002-11-16 Thread Derick Rethans
On Sat, 16 Nov 2002 [EMAIL PROTECTED] wrote:

 After having reviewed this one, I saw few changes to do, I asked Pollita
 and he did them. He is sending a new patch and I vote +1 for it.

I would favor discussing those private things on the developers list, as 
it's exactly meant for that.

Derick

 Pollita [EMAIL PROTECTED] a écrit dans le message de news:
 [EMAIL PROTECTED]
  The three attached patch files (to be applied in ext/standard/ ) introduce
  a new function: getanyrr().  Where the existing getmxrr() will retrieve MX
  records for a given host, getanyrr() will return all standard INET DNS
  Resource Records.
 
  proto:
array getanyrr(string hostname [, string type[, array authns, array
  addtl]])
 
  Type is optional and can be any of ANY, A, MX, CNAME, NS,
  TXT, SOA, HINFO, or PTR.  ANY is default.
 
  getanyrr returns an index array of associative arrays.  Each associative
  array contains 'host', 'type', 'class', 'ttl', and one or more additional
  records depending on type.
 
  The third and fourth arguments are pass-by-ref arrays with the same
  structure as the function return argument.  authns contains a list of
  authoritative name servers, while addtl contains additional relevant
  records (typically A records for the name servers).
 
  Further documentation to be submitted to PHP-DOC when and if attached
  patches are accepted and committed to CVS.
 
  basic_functions.cPatch against r1.543
  dns.cPatch against r1.44
  dns.hPatch against r1.11
 
 
 
 
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 

---
 Derick Rethans   http://derickrethans.nl/ 
 JDI Media Solutions
--[ if you hold a unix shell to your ear, do you hear the c? ]-


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




[PHP-DEV] Patch for ext/standard/tests/time/001.phpt

2002-11-16 Thread Michael Mauch
ext/standard/tests/time/001.phpt fails on Tru64, because the
gettimeofday(2) C library function has not enough granularity in the
standard configuration.
http://www2.tru64.org/pages.php?page=Tru64-FAQ-Programming says that
the clock's granularity is 1024 Hz normally, but can be increased by
rebuilding the kernel. But that shouldn't be of any concern for PHP or
for this test. Maybe a sentence about that should be added to the PHP
manual, e.g. something like: Although this function returns
microseconds, this doesn't necessarily mean that your system library
actually delivers such a high granularity.


--- ext/standard/tests/time/001.phpt~   Fri Nov 15 10:25:59 2002
+++ ext/standard/tests/time/001.phptSat Nov 16 18:41:56 2002
@@ -14,7 +14,7 @@
 
 for ($i=1;$i=10;$i++) {
list($micro,$time)=explode( ,microtime());
-   if ($time  $last_t || ($time == $last_t  $micro  $last_m)) {
+   if ($time  $last_t || ($time == $last_t  $micro = $last_m)) {
$passed++;
} else if ($failed++ =10) {
$result .= sprintf('%06d', $i).: $time $micro  $last_t $last_m\n;


Regards...
Michael

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




Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition

2002-11-16 Thread Marcus Börger
Function is nice but the function name is not.
Attached is a second revised patch that fixes the build problems.

marcus

At 00:11 17.11.2002, Pollita wrote:

Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth to
ext/standard/dns.c for addition of getanyrr() function.


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

cvs -z3 -q diff basic_functions.c dns.c dns.h (in directory S:\php4-HEAD\ext\standard)
Index: basic_functions.c
===
RCS file: /repository/php4/ext/standard/basic_functions.c,v
retrieving revision 1.543
diff -u -r1.543 basic_functions.c
--- basic_functions.c   8 Nov 2002 15:49:32 -   1.543
+++ basic_functions.c   17 Nov 2002 00:15:19 -
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: basic_functions.c,v 1.543 2002/11/08 15:49:32 sterling Exp $ */
+/* $Id: basic_functions.c,v 1.543 2002/11/16 13:18:21 pollita Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -440,6 +440,7 @@
 
 #if HAVE_RES_SEARCH  !(defined(__BEOS__) || defined(PHP_WIN32) || defined(NETWARE))
PHP_FE(checkdnsrr, 
 NULL)
+PHP_FE(getanyrr,third_and_rest_force_ref)
PHP_FE(getmxrr,second_and_third_args_force_ref)
 #endif
 
Index: dns.c
===
RCS file: /repository/php4/ext/standard/dns.c,v
retrieving revision 1.44
diff -u -r1.44 dns.c
--- dns.c   18 Oct 2002 22:08:23 -  1.44
+++ dns.c   17 Nov 2002 00:15:20 -
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: dns.c,v 1.44 2002/10/18 22:08:23 sniper Exp $ */
+/* $Id: dns.c,v 1.44 2002/11/16 14:51:58 pollita Exp $ */
 
 /* {{{ includes
  */
@@ -71,6 +71,13 @@
 #include dns.h
 /* }}} */
 
+#if HAVE_RES_SEARCH  !(defined(__BEOS__)||defined(PHP_WIN32))
+typedef union {
+   HEADER qb1;
+   u_char qb2[65536];
+} querybuf;
+#endif
+
 static char *php_gethostbyaddr(char *ip);
 static char *php_gethostbyname(char *name);
 
@@ -276,6 +283,251 @@
 #ifndef MAXHOSTNAMELEN
 #define MAXHOSTNAMELEN  256
 #endif /* MAXHOSTNAMELEN */
+
+#ifndef MAXRESOURCERECORDS
+#define MAXRESOURCERECORDS 64
+#endif /* MAXRESOURCERECORDS */
+
+/* {{{ php_parserr
+ */
+u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, zval **subarray) 
+{
+   u_short type, class, dlen;
+   u_long ttl;
+   long n, i;
+   char name[MAXHOSTNAMELEN];
+
+   n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof name) - 2);
+   if (n  0) {
+   return NULL;
+   }
+   cp += n;
+
+   GETSHORT(type,cp);
+   GETSHORT(class,cp);
+   GETLONG(ttl,cp);
+   GETSHORT(dlen,cp);
+   if (type_to_fetch != T_ANY  type != type_to_fetch) {
+   /* Should never actually occour */
+   cp += dlen;
+   return NULL;
+   }
+
+   MAKE_STD_ZVAL(*subarray);
+   if (array_init(*subarray) != SUCCESS) {
+   return NULL;
+   }
+   add_assoc_string(*subarray,host,name,1);
+
+   switch (type) {
+   case T_A:
+   add_assoc_string(*subarray,type,A,1);
+   sprintf(name,%d.%d.%d.%d,cp[0],cp[1],cp[2],cp[3]);
+   add_assoc_string(*subarray,ip,name,1);
+   cp += dlen;
+   break;
+   case T_MX:
+   add_assoc_string(*subarray,type,MX,1);
+   GETSHORT(n,cp);
+   add_assoc_long(*subarray,pri,n);
+   case T_CNAME:
+   if (type == T_CNAME)
+   add_assoc_string(*subarray,type,CNAME,1);
+   case T_NS:
+   if (type == T_NS)
+   add_assoc_string(*subarray,type,NS,1);
+   case T_PTR:
+   if (type == T_PTR)
+   add_assoc_string(*subarray,type,PTR,1);
+   n = dn_expand(answer-qb2,answer-qb2+65536,cp,name,(sizeof 
+name) - 2);
+   if (n  0) {
+   return NULL;
+   }
+   cp += n;
+   add_assoc_string(*subarray,target,name,1);
+   break;
+   case T_HINFO:
+   /* See RFC 1010 for values */
+   GETSHORT(n,cp);
+   add_assoc_long(*subarray,cpu,n);
+   GETSHORT(n,cp);
+   add_assoc_long(*subarray,os,n);
+   break;
+   case T_TXT:
+   add_assoc_string(*subarray,type,TXT,1);
+ 

Re: [PHP-DEV] ext/standard/tests/math/log.phpt coredump on Tru64

2002-11-16 Thread Pollita
log(0) in any base (except 0, which would be silly) is an undefined
number.  the libc log() function will return an exceedingly small number
to avoid causing widepsread panic when log(0) is attempted
(-1.7976931348623E+308 shown below).  The test function for log:

$x2 = (int) pow($base, log($x, $base));

attempts to check that $x2 is close to $x, but since log(0,*) will return
an excessively small number, pow() winds up choking.

Suggest: $x2 = (int) log(pow($x,base),$base); instead.

-Pollita

P.S. example below using log in base 1 is also nonsensical... only
log(1,1) is a valid use of log with a base parameter of 1, any other value
results in undefined

 Hi,

 php4-STABLE-200211152030 dumps core on Tru64/Alpha with
 ext/standard/tests/math/log.phpt:

  EXPECTED OUTPUT
 On failure, please mail result to [EMAIL PROTECTED]
 200
 50
 50
 50
 50
 50
 50
 50
 50
 50
  ACTUAL OUTPUT
 On failure, please mail result to [EMAIL PROTECTED]
 200
  FAILED

 Looking which values it doesn't like:

 # sapi/cli/php -r 'echo log(0, 2),\n;'
 Floating point exception (core dumped)
 # sapi/cli/php -r 'echo log(0, 3),\n;'
 -1.6363308087894E+308
 # sapi/cli/php -r 'echo log(0, 10),\n;'
 -7.8072820862606E+307
 # sapi/cli/php -r 'echo log(0, 1),\n;'
 Floating point exception (core dumped)
 # sapi/cli/php -r 'echo log(0),\n;'
 -1.7976931348623E+308

 Regards...
   Michael

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




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




[PHP-DEV] Patch for ext/standard/tests/math/hexdec.phpt

2002-11-16 Thread Michael Mauch
The hexdec test fails on 64 bit machines, because two big numbers still
fit into a PHP integer (on 32 bit, these are automatically converted
into floats):


/house/elmicha/local/src/php4-STABLE-200211152030/ext/standard/tests/math/hexdec.phpt


 EXPECTED OUTPUT
int(74565)
int(74565)
int(74565)
int(74565)
int(74565)
float(78187069441)
float(6442450943)
 ACTUAL OUTPUT
int(74565)
int(74565)
int(74565)
int(74565)
int(74565)
int(78187069441)
int(6442450943)
 FAILED


006- float(78187069441)
006+ int(78187069441)
007- float(6442450943)
007+ int(6442450943)



Patch:

--- ext/standard/tests/math/hexdec.phpt~Thu Oct  3 22:34:15 2002
+++ ext/standard/tests/math/hexdec.phpt Sat Nov 16 19:38:30 2002
@@ -8,8 +8,8 @@
 var_dump(hexdec(q12345));
 var_dump(hexdec(12345+?!));
 var_dump(hexdec(12345q));
-var_dump(hexdec(123451));
-var_dump(hexdec(17fff));
+var_dump((float)hexdec(123451));
+var_dump((float)hexdec(17fff));
 
 ?
 --EXPECT--


Regards...
Michael

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




Re: [PHP-DEV] [PATH] update to earlier proposed patch for getanyrr() function addition

2002-11-16 Thread nicos
Hello,

Who can commit that now?

Regards.
M.CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com Hébergement de sites internets.

Marcus Börger [EMAIL PROTECTED] a écrit dans le message de
news: [EMAIL PROTECTED]
 Function is nice but the function name is not.
 Attached is a second revised patch that fixes the build problems.

 marcus

 At 00:11 17.11.2002, Pollita wrote:
 Per corrections suggested by [EMAIL PROTECTED], attached is a revised pacth
to
 ext/standard/dns.c for addition of getanyrr() function.
 
 
 --
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php




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




[PHP-DEV] CVS Account Request: pollita

2002-11-16 Thread Sara Golemon
Address open items on bugs.php.net, developing patches where appropriate.  Also 
propose extensions such as my recent contributions to log() and the pending function 
getanyrr().

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




[PHP-DEV] Re: CVS Account Request: pollita

2002-11-16 Thread nicos
Hello,

Nice to see you finally asking for an account.
It would be really nice to see you joining the party :-)


Regards.
M.CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com Hébergement de sites internets.

Sara Golemon [EMAIL PROTECTED] a écrit dans le message de news:
[EMAIL PROTECTED]
 Address open items on bugs.php.net, developing patches where appropriate.
Also propose extensions such as my recent contributions to log() and the
pending function getanyrr().



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




[PHP-DEV] Re: Aggregation ZE2 fix

2002-11-16 Thread Andrei Zmievski
On Sat, 16 Nov 2002, Marcus Börger wrote:
 With the following patch aggregation works for me with ZE1 and ZE2,
 php 4.3.0 and php4.4-dev. If noone objects i will commit this.

Aggregation will be implemented at the engine level in ZE2. Don't commit
this patch.

-Andrei   http://www.gravitonic.com/

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