[PHP-CVS] svn: /php/php-src/trunk/ext/phar/tests/ phar_buildfromdirectory6.phpt

2009-11-20 Thread Brian Shire
shireSat, 21 Nov 2009 05:38:58 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=291107

Log:
Fix phar regex test when '.php' is part of the path, instead be more specific 
with '.php$' regex.

Changed paths:
U   php/php-src/trunk/ext/phar/tests/phar_buildfromdirectory6.phpt

Modified: php/php-src/trunk/ext/phar/tests/phar_buildfromdirectory6.phpt
===
--- php/php-src/trunk/ext/phar/tests/phar_buildfromdirectory6.phpt  
2009-11-21 03:05:14 UTC (rev 291106)
+++ php/php-src/trunk/ext/phar/tests/phar_buildfromdirectory6.phpt  
2009-11-21 05:38:58 UTC (rev 291107)
@@ -15,7 +15,7 @@

 try {
$phar = new Phar(dirname(__FILE__) . '/buildfromdirectory.phar');
-   var_dump($phar-buildFromDirectory(dirname(__FILE__) . '/testdir', 
'/\.php/'));
+   var_dump($phar-buildFromDirectory(dirname(__FILE__) . '/testdir', 
'/\.php$/'));
 } catch (Exception $e) {
var_dump(get_class($e));
echo $e-getMessage() . \n;

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

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/phar/tests/ phar_buildfromdirectory6.phpt

2009-11-20 Thread Brian Shire
shireSat, 21 Nov 2009 05:40:16 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=291108

Log:
MFH: Fix phar regex test when '.php' is part of the path, instead be more 
specific with '.php$' regex.

Changed paths:
U   
php/php-src/branches/PHP_5_3/ext/phar/tests/phar_buildfromdirectory6.phpt

Modified: 
php/php-src/branches/PHP_5_3/ext/phar/tests/phar_buildfromdirectory6.phpt
===
--- php/php-src/branches/PHP_5_3/ext/phar/tests/phar_buildfromdirectory6.phpt   
2009-11-21 05:38:58 UTC (rev 291107)
+++ php/php-src/branches/PHP_5_3/ext/phar/tests/phar_buildfromdirectory6.phpt   
2009-11-21 05:40:16 UTC (rev 291108)
@@ -15,7 +15,7 @@

 try {
$phar = new Phar(dirname(__FILE__) . '/buildfromdirectory.phar');
-   var_dump($phar-buildFromDirectory(dirname(__FILE__) . '/testdir', 
'/\.php/'));
+   var_dump($phar-buildFromDirectory(dirname(__FILE__) . '/testdir', 
'/\.php$/'));
 } catch (Exception $e) {
var_dump(get_class($e));
echo $e-getMessage() . \n;

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

[PHP-CVS] cvs: php-src /ext/standard/tests/general_functions bug47859.phpt

2009-06-03 Thread Brian Shire
shire   Wed Jun  3 19:37:23 2009 UTC

  Added files: 
/php-src/ext/standard/tests/general_functions   bug47859.phpt 
  Log:
  Add test for Bug #47859 parse_ini_file() does not like asterisk (*) in key in 
the beginning
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug47859.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/general_functions/bug47859.phpt
+++ php-src/ext/standard/tests/general_functions/bug47859.phpt
--TEST--
Bug #47859  parse_ini_file() does not like asterisk (*) in key in the 
beginning
--FILE--
?php
var_dump(parse_ini_string('*key = *value'));
var_dump(parse_ini_string('-key = -value'));
var_dump(parse_ini_string('_key = _value'));

var_dump(parse_ini_string('key* = value*'));
var_dump(parse_ini_string('key.*.* = value.*.*'));
var_dump(parse_ini_string('*.*.key = *.*.value'));
var_dump(parse_ini_string('k*e*y = v*a*lue'));
?
--EXPECT--
array(1) {
  [*key]=
  string(6) *value
}
array(1) {
  [-key]=
  string(6) -value
}
array(1) {
  [_key]=
  string(6) _value
}
array(1) {
  [key*]=
  string(6) value*
}
array(1) {
  [key.*.*]=
  string(9) value.*.*
}
array(1) {
  [*.*.key]=
  string(9) *.*.value
}
array(1) {
  [k*e*y]=
  string(7) v*a*lue
}



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/general_functions bug47859.phpt

2009-06-03 Thread Brian Shire
shire   Wed Jun  3 19:37:26 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/general_functions   bug47859.phpt 
  Log:
  MFH: Add test for Bug #47859 parse_ini_file() does not like asterisk (*) in 
key in the beginning
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/bug47859.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/general_functions/bug47859.phpt
+++ php-src/ext/standard/tests/general_functions/bug47859.phpt
--TEST--
Bug #47859  parse_ini_file() does not like asterisk (*) in key in the 
beginning
--FILE--
?php
var_dump(parse_ini_string('*key = *value'));
var_dump(parse_ini_string('-key = -value'));
var_dump(parse_ini_string('_key = _value'));

var_dump(parse_ini_string('key* = value*'));
var_dump(parse_ini_string('key.*.* = value.*.*'));
var_dump(parse_ini_string('*.*.key = *.*.value'));
var_dump(parse_ini_string('k*e*y = v*a*lue'));
?
--EXPECT--
array(1) {
  [*key]=
  string(6) *value
}
array(1) {
  [-key]=
  string(6) -value
}
array(1) {
  [_key]=
  string(6) _value
}
array(1) {
  [key*]=
  string(6) value*
}
array(1) {
  [key.*.*]=
  string(9) value.*.*
}
array(1) {
  [*.*.key]=
  string(9) *.*.value
}
array(1) {
  [k*e*y]=
  string(7) v*a*lue
}



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/curl interface.c

2009-05-07 Thread Brian Shire
shire   Fri May  8 03:33:06 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/curl   interface.c 
  Log:
  MFH: Add missing #ifdef for curl version that does not have FTP_FILEMETHOD or 
IPRESOLVE options. related to fix for bug #39637
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.62.2.14.2.27.2.38r2=1.62.2.14.2.27.2.39diff_format=u
Index: php-src/ext/curl/interface.c
diff -u php-src/ext/curl/interface.c:1.62.2.14.2.27.2.38 
php-src/ext/curl/interface.c:1.62.2.14.2.27.2.39
--- php-src/ext/curl/interface.c:1.62.2.14.2.27.2.38Mon May  4 14:11:45 2009
+++ php-src/ext/curl/interface.cFri May  8 03:33:06 2009
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: interface.c,v 1.62.2.14.2.27.2.38 2009/05/04 14:11:45 pajoye Exp $ */
+/* $Id: interface.c,v 1.62.2.14.2.27.2.39 2009/05/08 03:33:06 shire Exp $ */
 
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
@@ -449,10 +449,12 @@
   of options and which version they were introduced */
 
/* Constants for curl_setopt() */
+#if LIBCURL_VERSION_NUM  0x070a07 /* CURLOPT_IPRESOLVE is available since 
curl 7.10.8 */
REGISTER_CURL_CONSTANT(CURLOPT_IPRESOLVE);
REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_WHATEVER);
REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V4);
REGISTER_CURL_CONSTANT(CURL_IPRESOLVE_V6);
+#endif
REGISTER_CURL_CONSTANT(CURLOPT_DNS_USE_GLOBAL_CACHE);
REGISTER_CURL_CONSTANT(CURLOPT_DNS_CACHE_TIMEOUT);
REGISTER_CURL_CONSTANT(CURLOPT_PORT);
@@ -1528,8 +1530,12 @@
case CURLOPT_REDIR_PROTOCOLS:
case CURLOPT_PROTOCOLS:
 #endif
+#if LIBCURL_VERSION_NUM  0x070a07 /* CURLOPT_IPRESOLVE is available since 
curl 7.10.8 */
case CURLOPT_IPRESOLVE:
+#endif
+#if LIBCURL_VERSION_NUM = 0x070f01
case CURLOPT_FTP_FILEMETHOD:
+#endif
convert_to_long_ex(zvalue);
error = curl_easy_setopt(ch-cp, option, 
Z_LVAL_PP(zvalue));
break;



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



[PHP-CVS] cvs: php-src /ext/tokenizer Makefile.frag

2009-03-01 Thread Brian Shire
shire   Mon Mar  2 03:54:01 2009 UTC

  Modified files:  
/php-src/ext/tokenizer  Makefile.frag 
  Log:
  fix tokenizer makefile dependencies on parser/scanner files when built 
dynamically. (See bug #38762)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/Makefile.frag?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/tokenizer/Makefile.frag
diff -u php-src/ext/tokenizer/Makefile.frag:1.6 
php-src/ext/tokenizer/Makefile.frag:1.7
--- php-src/ext/tokenizer/Makefile.frag:1.6 Thu Mar 27 08:32:48 2008
+++ php-src/ext/tokenizer/Makefile.frag Mon Mar  2 03:54:01 2009
@@ -1,3 +1,4 @@
-
+$(top_srcdir)/Zend/zend_language_parser.c:
+$(top_srcdir)/Zend/zend_language_scanner.c:
 $(builddir)/tokenizer.lo: $(top_srcdir)/Zend/zend_language_parser.c 
$(top_srcdir)/Zend/zend_language_scanner.c
 



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/tokenizer Makefile.frag

2009-03-01 Thread Brian Shire
shire   Mon Mar  2 03:54:04 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/tokenizer  Makefile.frag 
  Log:
  MFH: fix tokenizer makefile dependencies on parser/scanner files when built 
dynamically. (See bug #38762)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/tokenizer/Makefile.frag?r1=1.3.6.1.2.1r2=1.3.6.1.2.2diff_format=u
Index: php-src/ext/tokenizer/Makefile.frag
diff -u php-src/ext/tokenizer/Makefile.frag:1.3.6.1.2.1 
php-src/ext/tokenizer/Makefile.frag:1.3.6.1.2.2
--- php-src/ext/tokenizer/Makefile.frag:1.3.6.1.2.1 Sun Mar 16 21:06:53 2008
+++ php-src/ext/tokenizer/Makefile.frag Mon Mar  2 03:54:04 2009
@@ -1,2 +1,3 @@
-
+$(top_srcdir)/Zend/zend_language_parser.c:
+$(top_srcdir)/Zend/zend_language_scanner.c:
 $(builddir)/tokenizer.lo: $(top_srcdir)/Zend/zend_language_parser.c 
$(top_srcdir)/Zend/zend_language_scanner.c



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



[PHP-CVS] cvs: php-src /ext/standard string.c /ext/standard/tests/strings explode.phpt

2008-12-26 Thread Brian Shire
shire   Sat Dec 27 05:13:30 2008 UTC

  Modified files:  
/php-src/ext/standard   string.c 
/php-src/ext/standard/tests/strings explode.phpt 
  Log:
  fix explode behavior to respect negative limit when string is empty.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.686r2=1.687diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.686 php-src/ext/standard/string.c:1.687
--- php-src/ext/standard/string.c:1.686 Mon Nov 24 19:31:02 2008
+++ php-src/ext/standard/string.c   Sat Dec 27 05:13:29 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.686 2008/11/24 19:31:02 lbarnaud Exp $ */
+/* $Id: string.c,v 1.687 2008/12/27 05:13:29 shire Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1294,10 +1294,12 @@
array_init(return_value);
 
if ( str_len == 0 ) {
-   if ( str_type == IS_UNICODE ) {
-   add_next_index_unicodel(return_value, USTR_MAKE(), 
sizeof()-1, 0);
-   } else {
-   add_next_index_stringl(return_value, , sizeof()-1, 
1);
+   if (limit = 0 || argc == 2) {
+   if ( str_type == IS_UNICODE ) {
+   add_next_index_unicodel(return_value, 
USTR_MAKE(), sizeof()-1, 0);
+   } else {
+   add_next_index_stringl(return_value, , 
sizeof()-1, 1);
+   }
}
return;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode.phpt?r1=1.9r2=1.10diff_format=u
Index: php-src/ext/standard/tests/strings/explode.phpt
diff -u php-src/ext/standard/tests/strings/explode.phpt:1.9 
php-src/ext/standard/tests/strings/explode.phpt:1.10
--- php-src/ext/standard/tests/strings/explode.phpt:1.9 Tue May 27 10:50:45 2008
+++ php-src/ext/standard/tests/strings/explode.phpt Sat Dec 27 05:13:30 2008
@@ -18,6 +18,7 @@
 var_dump(@explode(NULL, a));
 var_dump(@explode(abc, acb));
 var_dump(@explode(somestring, otherstring));
+var_dump(@explode(somestring, otherstring, -1));
 var_dump(@explode(a, aa));
 var_dump(@explode(==, str_repeat(-=.ord(0).=-, 10)));
 var_dump(@explode(=, str_repeat(-=.ord(0).=-, 10)));
@@ -64,6 +65,8 @@
   [0]=
   unicode(11) otherstring
 }
+array(0) {
+}
 array(7) {
   [0]=
   unicode(0) 



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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard string.c /ext/standard/tests/strings explode.phpt

2008-12-26 Thread Brian Shire
shire   Sat Dec 27 05:15:51 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   string.c 
/php-src/ext/standard/tests/strings explode.phpt 
  Log:
  MFH: fix explode behavior to respect negative limit when string is empty.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.69.2.38r2=1.445.2.14.2.69.2.39diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.69.2.38 
php-src/ext/standard/string.c:1.445.2.14.2.69.2.39
--- php-src/ext/standard/string.c:1.445.2.14.2.69.2.38  Fri Nov 21 19:16:50 2008
+++ php-src/ext/standard/string.c   Sat Dec 27 05:15:51 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.69.2.38 2008/11/21 19:16:50 felipe Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.69.2.39 2008/12/27 05:15:51 shire Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1018,7 +1018,9 @@
array_init(return_value);
 
if (! Z_STRLEN_PP(str)) {
-   add_next_index_stringl(return_value, , sizeof() - 1, 1);
+   if (limit = 0 || argc == 2) {
+   add_next_index_stringl(return_value, , sizeof() - 
1, 1);
+   } 
return;
}
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode.phpt?r1=1.4.4.1.2.1r2=1.4.4.1.2.2diff_format=u
Index: php-src/ext/standard/tests/strings/explode.phpt
diff -u php-src/ext/standard/tests/strings/explode.phpt:1.4.4.1.2.1 
php-src/ext/standard/tests/strings/explode.phpt:1.4.4.1.2.2
--- php-src/ext/standard/tests/strings/explode.phpt:1.4.4.1.2.1 Tue Dec 18 
10:53:39 2007
+++ php-src/ext/standard/tests/strings/explode.phpt Sat Dec 27 05:15:51 2008
@@ -17,6 +17,7 @@
 var_dump(@explode(NULL, a));
 var_dump(@explode(abc, acb));
 var_dump(@explode(somestring, otherstring));
+var_dump(@explode(somestring, otherstring, -1));
 var_dump(@explode(a, aa));
 var_dump(@explode(==, str_repeat(-=.ord(0).=-, 10)));
 var_dump(@explode(=, str_repeat(-=.ord(0).=-, 10)));
@@ -63,6 +64,8 @@
   [0]=
   string(11) otherstring
 }
+array(0) {
+}
 array(7) {
   [0]=
   string(0) 



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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard string.c /ext/standard/tests/strings explode.phpt

2008-12-26 Thread Brian Shire
shire   Sat Dec 27 05:20:27 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/standard   string.c 
/php-src/ext/standard/tests/strings explode.phpt 
  Log:
  MFH: fix explode behavior to respect negative limit when string is empty.
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1369r2=1.2027.2.547.2.1370diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1369 php-src/NEWS:1.2027.2.547.2.1370
--- php-src/NEWS:1.2027.2.547.2.1369Sat Dec 27 03:07:46 2008
+++ php-src/NEWSSat Dec 27 05:20:27 2008
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 2009, PHP 5.2.9
+- Fixed explode() behavior to respect negative limit when string is empty. 
(shire)
 - Added optional sorting type flag parameter to array_unique(), default is
   SORT_REGULAR. (Andrei)
 - Fixed security issue in imagerotate(), background colour isn't validated
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.77r2=1.445.2.14.2.78diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.77 
php-src/ext/standard/string.c:1.445.2.14.2.78
--- php-src/ext/standard/string.c:1.445.2.14.2.77   Wed Nov  5 18:55:02 2008
+++ php-src/ext/standard/string.c   Sat Dec 27 05:20:27 2008
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.77 2008/11/05 18:55:02 felipe Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.78 2008/12/27 05:20:27 shire Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1033,7 +1033,9 @@
array_init(return_value);
 
if (! Z_STRLEN_PP(str)) {
-   add_next_index_stringl(return_value, , sizeof() - 1, 1);
+   if (limit = 0 || argc == 2) {
+   add_next_index_stringl(return_value, , sizeof() - 
1, 1);
+   } 
return;
}
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode.phpt?r1=1.4.4.2r2=1.4.4.3diff_format=u
Index: php-src/ext/standard/tests/strings/explode.phpt
diff -u php-src/ext/standard/tests/strings/explode.phpt:1.4.4.2 
php-src/ext/standard/tests/strings/explode.phpt:1.4.4.3
--- php-src/ext/standard/tests/strings/explode.phpt:1.4.4.2 Wed Dec 19 
08:45:16 2007
+++ php-src/ext/standard/tests/strings/explode.phpt Sat Dec 27 05:20:27 2008
@@ -17,6 +17,7 @@
 var_dump(@explode(NULL, a));
 var_dump(@explode(abc, acb));
 var_dump(@explode(somestring, otherstring));
+var_dump(@explode(somestring, otherstring, -1));
 var_dump(@explode(a, aa));
 var_dump(@explode(==, str_repeat(-=.ord(0).=-, 10)));
 var_dump(@explode(=, str_repeat(-=.ord(0).=-, 10)));
@@ -63,6 +64,8 @@
   [0]=
   string(11) otherstring
 }
+array(0) {
+}
 array(7) {
   [0]=
   string(0) 



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



[PHP-CVS] cvs: php-src /ext/standard array.c /ext/standard/tests/array bug42850.phpt

2008-01-14 Thread Brian Shire
shire   Mon Jan 14 22:08:00 2008 UTC

  Added files: 
/php-src/ext/standard/tests/array   bug42850.phpt 

  Modified files:  
/php-src/ext/standard   array.c 
  Log:
  Fix bug #42850 array_walk_recursive() leaves references, refix bug #34982
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.434r2=1.435diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.434 php-src/ext/standard/array.c:1.435
--- php-src/ext/standard/array.c:1.434  Mon Dec 31 07:12:15 2007
+++ php-src/ext/standard/array.cMon Jan 14 22:08:00 2008
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.434 2007/12/31 07:12:15 sebastian Exp $ */
+/* $Id: array.c,v 1.435 2008/01/14 22:08:00 shire Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1061,7 +1061,7 @@
zend_fcall_info orig_array_walk_fci;
zend_fcall_info_cache orig_array_walk_fci_cache;
 
-   SEPARATE_ZVAL_TO_MAKE_IS_REF(args[0]);
+   SEPARATE_ZVAL_IF_NOT_REF(args[0]);
thash = HASH_OF(*(args[0]));
if (thash-nApplyCount  1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
recursion detected);

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug42850.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/array/bug42850.phpt
+++ php-src/ext/standard/tests/array/bug42850.phpt
--TEST--
Bug #42850 array_walk_recursive() leaves references, #34982 
array_walk_recursive() modifies elements outside function scope 
--FILE--
?php

// Bug #42850
$data = array ('key1' = 'val1', array('key2' = 'val2'));
function apply_dumb($item, $key) {}; 
var_dump($data);
array_walk_recursive($data, 'apply_dumb');
$data2 = $data;
$data2[0] = 'altered';
var_dump($data);
var_dump($data2);

// Bug #34982
function myfunc($data) {
array_walk_recursive($data, 'apply_changed');
}
function apply_changed($input, $key) {
$input = 'changed';
}
myfunc($data);
var_dump($data);

--EXPECT--
array(2) {
  [key1]=
  string(4) val1
  [0]=
  array(1) {
[key2]=
string(4) val2
  }
}
array(2) {
  [key1]=
  string(4) val1
  [0]=
  array(1) {
[key2]=
string(4) val2
  }
}
array(2) {
  [key1]=
  string(4) val1
  [0]=
  string(7) altered
}
array(2) {
  [key1]=
  string(4) val1
  [0]=
  array(1) {
[key2]=
string(4) val2
  }
}
--UEXPECT--
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  array(1) {
[ukey2]=
unicode(4) val2
  }
}
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  array(1) {
[ukey2]=
unicode(4) val2
  }
}
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  unicode(7) altered
}
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  array(1) {
[ukey2]=
unicode(4) val2
  }
}

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard array.c /ext/standard/tests/array bug42850.phpt

2008-01-14 Thread Brian Shire
shire   Mon Jan 14 22:09:52 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/array   bug42850.phpt 

  Modified files:  
/php-src/ext/standard   array.c 
  Log:
  MFH: Fix bug #42850 array_walk_recursive() leaves references, refix bug #34982
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.37.2.13r2=1.308.2.21.2.37.2.14diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.37.2.13 
php-src/ext/standard/array.c:1.308.2.21.2.37.2.14
--- php-src/ext/standard/array.c:1.308.2.21.2.37.2.13   Mon Dec 31 07:17:14 2007
+++ php-src/ext/standard/array.cMon Jan 14 22:09:52 2008
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.37.2.13 2007/12/31 07:17:14 sebastian Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.37.2.14 2008/01/14 22:09:52 shire Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1038,7 +1038,7 @@
zend_fcall_info orig_array_walk_fci;
zend_fcall_info_cache orig_array_walk_fci_cache;
 
-   SEPARATE_ZVAL_TO_MAKE_IS_REF(args[0]);
+   SEPARATE_ZVAL_IF_NOT_REF(args[0]);
thash = HASH_OF(*(args[0]));
if (thash-nApplyCount  1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
recursion detected);

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug42850.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/array/bug42850.phpt
+++ php-src/ext/standard/tests/array/bug42850.phpt
--TEST--
Bug #42850 array_walk_recursive() leaves references, #34982 
array_walk_recursive() modifies elements outside function scope 
--FILE--
?php

// Bug #42850
$data = array ('key1' = 'val1', array('key2' = 'val2'));
function apply_dumb($item, $key) {}; 
var_dump($data);
array_walk_recursive($data, 'apply_dumb');
$data2 = $data;
$data2[0] = 'altered';
var_dump($data);
var_dump($data2);

// Bug #34982
function myfunc($data) {
array_walk_recursive($data, 'apply_changed');
}
function apply_changed($input, $key) {
$input = 'changed';
}
myfunc($data);
var_dump($data);

--EXPECT--
array(2) {
  [key1]=
  string(4) val1
  [0]=
  array(1) {
[key2]=
string(4) val2
  }
}
array(2) {
  [key1]=
  string(4) val1
  [0]=
  array(1) {
[key2]=
string(4) val2
  }
}
array(2) {
  [key1]=
  string(4) val1
  [0]=
  string(7) altered
}
array(2) {
  [key1]=
  string(4) val1
  [0]=
  array(1) {
[key2]=
string(4) val2
  }
}
--UEXPECT--
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  array(1) {
[ukey2]=
unicode(4) val2
  }
}
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  array(1) {
[ukey2]=
unicode(4) val2
  }
}
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  unicode(7) altered
}
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  array(1) {
[ukey2]=
unicode(4) val2
  }
}

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard array.c /ext/standard/tests/array bug42850.phpt

2008-01-14 Thread Brian Shire
shire   Mon Jan 14 22:10:09 2008 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/array   bug42850.phpt 

  Modified files:  
/php-src/ext/standard   array.c 
  Log:
  MFH: Fix bug #42850 array_walk_recursive() leaves references, refix bug #34982
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.46r2=1.308.2.21.2.47diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.46 
php-src/ext/standard/array.c:1.308.2.21.2.47
--- php-src/ext/standard/array.c:1.308.2.21.2.46Mon Dec 31 07:20:12 2007
+++ php-src/ext/standard/array.cMon Jan 14 22:10:08 2008
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.46 2007/12/31 07:20:12 sebastian Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.47 2008/01/14 22:10:08 shire Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1077,7 +1077,7 @@
if (recursive  Z_TYPE_PP(args[0]) == IS_ARRAY) {
HashTable *thash;

-   SEPARATE_ZVAL_TO_MAKE_IS_REF(args[0]);
+   SEPARATE_ZVAL_IF_NOT_REF(args[0]);
thash = HASH_OF(*(args[0]));
if (thash-nApplyCount  1) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
recursion detected);

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug42850.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/array/bug42850.phpt
+++ php-src/ext/standard/tests/array/bug42850.phpt
--TEST--
Bug #42850 array_walk_recursive() leaves references, #34982 
array_walk_recursive() modifies elements outside function scope 
--FILE--
?php

// Bug #42850
$data = array ('key1' = 'val1', array('key2' = 'val2'));
function apply_dumb($item, $key) {}; 
var_dump($data);
array_walk_recursive($data, 'apply_dumb');
$data2 = $data;
$data2[0] = 'altered';
var_dump($data);
var_dump($data2);

// Bug #34982
function myfunc($data) {
array_walk_recursive($data, 'apply_changed');
}
function apply_changed($input, $key) {
$input = 'changed';
}
myfunc($data);
var_dump($data);

--EXPECT--
array(2) {
  [key1]=
  string(4) val1
  [0]=
  array(1) {
[key2]=
string(4) val2
  }
}
array(2) {
  [key1]=
  string(4) val1
  [0]=
  array(1) {
[key2]=
string(4) val2
  }
}
array(2) {
  [key1]=
  string(4) val1
  [0]=
  string(7) altered
}
array(2) {
  [key1]=
  string(4) val1
  [0]=
  array(1) {
[key2]=
string(4) val2
  }
}
--UEXPECT--
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  array(1) {
[ukey2]=
unicode(4) val2
  }
}
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  array(1) {
[ukey2]=
unicode(4) val2
  }
}
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  unicode(7) altered
}
array(2) {
  [ukey1]=
  unicode(4) val1
  [0]=
  array(1) {
[ukey2]=
unicode(4) val2
  }
}

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



[PHP-CVS] cvs: php-src /ext/standard http.c

2008-01-10 Thread Brian Shire
shire   Thu Jan 10 20:28:08 2008 UTC

  Modified files:  
/php-src/ext/standard   http.c 
  Log:
  - fix truncation of large values on 64-bit systems in http_build_query
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/http.c?r1=1.28r2=1.29diff_format=u
Index: php-src/ext/standard/http.c
diff -u php-src/ext/standard/http.c:1.28 php-src/ext/standard/http.c:1.29
--- php-src/ext/standard/http.c:1.28Mon Dec 31 07:12:15 2007
+++ php-src/ext/standard/http.c Thu Jan 10 20:28:08 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: http.c,v 1.28 2007/12/31 07:12:15 sebastian Exp $ */
+/* $Id: http.c,v 1.29 2008/01/10 20:28:08 shire Exp $ */
 
 #include php_http.h
 #include php_ini.h
@@ -121,7 +121,7 @@
*p = '\0';
} else {
/* Is an integer key */
-   ekey_len = spprintf(ekey, 12, %ld, idx);
+   ekey_len = spprintf(ekey, 0, %ld, idx);
newprefix_len = key_prefix_len + num_prefix_len 
+ ekey_len + key_suffix_len + 3 /* %5B */;
newprefix = emalloc(newprefix_len + 1);
p = newprefix;
@@ -172,7 +172,7 @@
if (num_prefix) {
smart_str_appendl(formstr, num_prefix, 
num_prefix_len);
}
-   ekey_len = spprintf(ekey, 12, %ld, idx);
+   ekey_len = spprintf(ekey, 0, %ld, idx);
smart_str_appendl(formstr, ekey, ekey_len);
efree(ekey);
}
@@ -198,10 +198,10 @@
break;
case IS_LONG:
case IS_BOOL:
-   ekey_len = spprintf(ekey, 12, %ld, 
Z_LVAL_PP(zdata));
+   ekey_len = spprintf(ekey, 0, %ld, 
Z_LVAL_PP(zdata));
break;
case IS_DOUBLE:
-   ekey_len = spprintf(ekey, 48, %.*G, 
(int) EG(precision), Z_DVAL_PP(zdata));
+   ekey_len = spprintf(ekey, 0, %.*G, 
(int) EG(precision), Z_DVAL_PP(zdata));
break;
default:
/* fall back on convert to string */

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



[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard http.c

2008-01-10 Thread Brian Shire
shire   Thu Jan 10 20:29:12 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   http.c 
  Log:
  - MFH fix truncation of large values on 64-bit systems in http_build_query
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/http.c?r1=1.14.2.4.2.3.2.2r2=1.14.2.4.2.3.2.3diff_format=u
Index: php-src/ext/standard/http.c
diff -u php-src/ext/standard/http.c:1.14.2.4.2.3.2.2 
php-src/ext/standard/http.c:1.14.2.4.2.3.2.3
--- php-src/ext/standard/http.c:1.14.2.4.2.3.2.2Mon Dec 31 07:17:15 2007
+++ php-src/ext/standard/http.c Thu Jan 10 20:29:12 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: http.c,v 1.14.2.4.2.3.2.2 2007/12/31 07:17:15 sebastian Exp $ */
+/* $Id: http.c,v 1.14.2.4.2.3.2.3 2008/01/10 20:29:12 shire Exp $ */
 
 #include php_http.h
 #include php_ini.h
@@ -105,7 +105,7 @@
*p = '\0';
} else {
/* Is an integer key */
-   ekey_len = spprintf(ekey, 12, %ld, idx);
+   ekey_len = spprintf(ekey, 0, %ld, idx);
newprefix_len = key_prefix_len + num_prefix_len 
+ ekey_len + key_suffix_len + 3 /* %5B */;
newprefix = emalloc(newprefix_len + 1);
p = newprefix;
@@ -153,7 +153,7 @@
if (num_prefix) {
smart_str_appendl(formstr, num_prefix, 
num_prefix_len);
}
-   ekey_len = spprintf(ekey, 12, %ld, idx);
+   ekey_len = spprintf(ekey, 0, %ld, idx);
smart_str_appendl(formstr, ekey, ekey_len);
efree(ekey);
}
@@ -165,10 +165,10 @@
break;
case IS_LONG:
case IS_BOOL:
-   ekey_len = spprintf(ekey, 12, %ld, 
Z_LVAL_PP(zdata));
+   ekey_len = spprintf(ekey, 0, %ld, 
Z_LVAL_PP(zdata));
break;
case IS_DOUBLE:
-   ekey_len = spprintf(ekey, 48, %.*G, 
(int) EG(precision), Z_DVAL_PP(zdata));
+   ekey_len = spprintf(ekey, 0, %.*G, 
(int) EG(precision), Z_DVAL_PP(zdata));
break;
default:
/* fall back on convert to string */

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard http.c

2008-01-10 Thread Brian Shire
shire   Thu Jan 10 20:32:41 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   http.c 
  Log:
  - MFH fix truncation of large values on 64-bit systems in http_build_query
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/http.c?r1=1.14.2.4.2.5r2=1.14.2.4.2.6diff_format=u
Index: php-src/ext/standard/http.c
diff -u php-src/ext/standard/http.c:1.14.2.4.2.5 
php-src/ext/standard/http.c:1.14.2.4.2.6
--- php-src/ext/standard/http.c:1.14.2.4.2.5Mon Dec 31 07:20:12 2007
+++ php-src/ext/standard/http.c Thu Jan 10 20:32:41 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: http.c,v 1.14.2.4.2.5 2007/12/31 07:20:12 sebastian Exp $ */
+/* $Id: http.c,v 1.14.2.4.2.6 2008/01/10 20:32:41 shire Exp $ */
 
 #include php_http.h
 #include php_ini.h
@@ -105,7 +105,7 @@
*p = '\0';
} else {
/* Is an integer key */
-   ekey_len = spprintf(ekey, 12, %ld, idx);
+   ekey_len = spprintf(ekey, 0, %ld, idx);
newprefix_len = key_prefix_len + num_prefix_len 
+ ekey_len + key_suffix_len + 3 /* %5B */;
newprefix = emalloc(newprefix_len + 1);
p = newprefix;
@@ -153,7 +153,7 @@
if (num_prefix) {
smart_str_appendl(formstr, num_prefix, 
num_prefix_len);
}
-   ekey_len = spprintf(ekey, 12, %ld, idx);
+   ekey_len = spprintf(ekey, 0, %ld, idx);
smart_str_appendl(formstr, ekey, ekey_len);
efree(ekey);
}
@@ -165,10 +165,10 @@
break;
case IS_LONG:
case IS_BOOL:
-   ekey_len = spprintf(ekey, 12, %ld, 
Z_LVAL_PP(zdata));
+   ekey_len = spprintf(ekey, 0, %ld, 
Z_LVAL_PP(zdata));
break;
case IS_DOUBLE:
-   ekey_len = spprintf(ekey, 48, %.*G, 
(int) EG(precision), Z_DVAL_PP(zdata));
+   ekey_len = spprintf(ekey, 0, %.*G, 
(int) EG(precision), Z_DVAL_PP(zdata));
break;
default:
/* fall back on convert to string */

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



[PHP-CVS] cvs: php-src /ext/standard formatted_print.c

2007-06-03 Thread Brian Shire
shire   Sun Jun  3 09:11:52 2007 UTC

  Modified files:  
/php-src/ext/standard   formatted_print.c 
  Log:
  Change printf %u behavior so that it does not truncate numbers at 32-bits.  
(Reported by Aditya Agarwal.)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/formatted_print.c?r1=1.100r2=1.101diff_format=u
Index: php-src/ext/standard/formatted_print.c
diff -u php-src/ext/standard/formatted_print.c:1.100 
php-src/ext/standard/formatted_print.c:1.101
--- php-src/ext/standard/formatted_print.c:1.100Thu May 17 17:29:09 2007
+++ php-src/ext/standard/formatted_print.c  Sun Jun  3 09:11:52 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: formatted_print.c,v 1.100 2007/05/17 17:29:09 tony2001 Exp $ */
+/* $Id: formatted_print.c,v 1.101 2007/06/03 09:11:52 shire Exp $ */
 
 #include math.h  /* modf() */
 #include php.h
@@ -278,7 +278,7 @@
 
PRINTF_DEBUG((sprintf: appenduint(%x, %x, %x, %d, %d, '%c', %d)\n,
  *buffer, pos, size, number, width, padding, 
alignment));
-   magn = (unsigned int) number;
+   magn = (unsigned long) number;
 
/* Can't right-pad 0's on integers */
if (alignment == 0  padding == '0') padding = ' ';

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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard formatted_print.c

2007-06-03 Thread Brian Shire


Yeah will do I only tested 32-bit. :-(

On Jun 3, 2007, at 9:17 AM, Ilia Alshanetsky wrote:


Brian,

This patch looks to have been broken a few *printf tests on 64 bit  
platforms, can you please review them to make sure the new behavior  
is indeed the correct one and adjust them if necessary.


Thanks,

Ilia


- Shire
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/array bug35014_64bit.phpt /ext/standard/tests/strings bug23894.phpt bug26973.phpt printf_64bit.phpt sprintf_f_2.phpt

2007-06-03 Thread Brian Shire
shire   Mon Jun  4 01:23:07 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/array   bug35014_64bit.phpt 
/php-src/ext/standard/tests/strings bug23894.phpt bug26973.phpt 
printf_64bit.phpt 
sprintf_f_2.phpt 
  Log:
  fix sprintf/printf %u tests so they work correctly on both 32-bit and 64-bit. 
(broken in previous fix)
  # just made these EXPECTREGEX expressions, if there's a prefered way to 
comply with both 32/64 bit let me know.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug35014_64bit.phpt?r1=1.1.2.1r2=1.1.2.1.2.1diff_format=u
Index: php-src/ext/standard/tests/array/bug35014_64bit.phpt
diff -u php-src/ext/standard/tests/array/bug35014_64bit.phpt:1.1.2.1 
php-src/ext/standard/tests/array/bug35014_64bit.phpt:1.1.2.1.2.1
--- php-src/ext/standard/tests/array/bug35014_64bit.phpt:1.1.2.1Fri Dec 
16 15:52:09 2005
+++ php-src/ext/standard/tests/array/bug35014_64bit.phptMon Jun  4 
01:23:07 2007
@@ -32,5 +32,5 @@
 int(9)
 float(1)
 int(99980001)
-float(2.8404260053903E+20)
-int(8589934590)
+float(1.219953680145E+30)
+float(3.6893488147419E+19)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug23894.phpt?r1=1.1r2=1.1.8.1diff_format=u
Index: php-src/ext/standard/tests/strings/bug23894.phpt
diff -u php-src/ext/standard/tests/strings/bug23894.phpt:1.1 
php-src/ext/standard/tests/strings/bug23894.phpt:1.1.8.1
--- php-src/ext/standard/tests/strings/bug23894.phpt:1.1Fri May 30 
13:48:14 2003
+++ php-src/ext/standard/tests/strings/bug23894.phptMon Jun  4 01:23:07 2007
@@ -8,8 +8,8 @@
 $test = sprintf(% 13u, $a);
 var_dump($test, bin2hex($test));
 ?
---EXPECT--
-string(4) -012
-string(8) 2d303132
-string(13)4294967284
-string(26) 20202034323934393637323834
+--EXPECTREGEX--
+string\(4\) \-012\
+string\(8\) \2d303132\
+(string\(13\) \   4294967284\|string\(20\) \18446744073709551604\)
+(string\(26\) \20202034323934393637323834\|string\(40\) 
\3138343436373434303733373039353531363034\)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug26973.phpt?r1=1.3r2=1.3.6.1diff_format=u
Index: php-src/ext/standard/tests/strings/bug26973.phpt
diff -u php-src/ext/standard/tests/strings/bug26973.phpt:1.3 
php-src/ext/standard/tests/strings/bug26973.phpt:1.3.6.1
--- php-src/ext/standard/tests/strings/bug26973.phpt:1.3Mon May 17 
20:58:57 2004
+++ php-src/ext/standard/tests/strings/bug26973.phptMon Jun  4 01:23:07 2007
@@ -18,17 +18,17 @@
 printf(%05u\n, -200);
 
 ?
---EXPECT--
-+0200
--0200
-+200.00
--200.00
+--EXPECTREGEX--
+\+0200
+\-0200
+\+200\.00
+\-200\.00
 00200
-4294967096
+(4294967096|18446744073709551416)
 ---
 00200
--0200
-200.00
--200.00
+\-0200
+200\.00
+\-200\.00
 00200
-4294967096
+(4294967096|18446744073709551416)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/printf_64bit.phpt?r1=1.1.2.3r2=1.1.2.4diff_format=u
Index: php-src/ext/standard/tests/strings/printf_64bit.phpt
diff -u php-src/ext/standard/tests/strings/printf_64bit.phpt:1.1.2.3 
php-src/ext/standard/tests/strings/printf_64bit.phpt:1.1.2.4
--- php-src/ext/standard/tests/strings/printf_64bit.phpt:1.1.2.3Mon May 
 7 21:38:42 2007
+++ php-src/ext/standard/tests/strings/printf_64bit.phptMon Jun  4 
01:23:07 2007
@@ -531,11 +531,11 @@
 
 0
 1
-4294967295
+18446744073709551615
 2
-4294967294
+18446744073709551614
 2333
-4271633963
+18446744073686218283
 1234
 
 *** Output for octal type ***
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_f_2.phpt?r1=1.1.2.5r2=1.1.2.6diff_format=u
Index: php-src/ext/standard/tests/strings/sprintf_f_2.phpt
diff -u php-src/ext/standard/tests/strings/sprintf_f_2.phpt:1.1.2.5 
php-src/ext/standard/tests/strings/sprintf_f_2.phpt:1.1.2.6
--- php-src/ext/standard/tests/strings/sprintf_f_2.phpt:1.1.2.5 Mon May  7 
22:30:16 2007
+++ php-src/ext/standard/tests/strings/sprintf_f_2.phpt Mon Jun  4 01:23:07 2007
@@ -80,37 +80,37 @@
  
 var_dump(sprintf(%.3e, $number)); // outputs 3.63e+8
 ?
---EXPECT--
-string(7) 100.426
-string(6) 100.43
-string(3) 100
-string(3) 100
-string(3) 144
-string(3) 144
-string(34) There are 100 monkeys in the world
-string(28) The 100.1 contains 0 monkeys
-string(30) The world contains 100 monkeys
-string(76) The world contains 100 monkeys.
-That's a nice world full of 100 monkeys.
-string(33) %b = '1010001010011010101101'
-string(8) %c = 'A'
-string(15) %d = '43951789'
-string(18) %e = '4.395179e+7'
-string(15) %u = '43951789'
-string(17) %u = '4251015507'
-string(22) %f = '43951789.00'
-string(16) %o = '247523255'
-string(15) %s = '43951789'
-string(14) %x = '29ea6ad'
-string(14) %X = '29EA6AD'
-string(17) %+d = '+43951789'
-string(17) %+d = '-43951789'
-string(8) [monkey]
-string(12) [monkey]
-string(12) [monkey]
-string(12) [monkey]
-string(12) 

[PHP-CVS] cvs: php-src /ext/standard/tests/array bug35014_64bit.phpt /ext/standard/tests/strings bug23894.phpt bug26973.phpt printf_64bit.phpt sprintf_f_2.phpt

2007-06-03 Thread Brian Shire
shire   Mon Jun  4 01:23:22 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/array   bug35014_64bit.phpt 
/php-src/ext/standard/tests/strings bug23894.phpt bug26973.phpt 
printf_64bit.phpt 
sprintf_f_2.phpt 
  Log:
  MFB: fix sprintf/printf %u tests so they work correctly on both 32-bit and 
64-bit. (broken in previous fix)
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug35014_64bit.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/standard/tests/array/bug35014_64bit.phpt
diff -u php-src/ext/standard/tests/array/bug35014_64bit.phpt:1.3 
php-src/ext/standard/tests/array/bug35014_64bit.phpt:1.4
--- php-src/ext/standard/tests/array/bug35014_64bit.phpt:1.3Tue Aug  8 
20:17:31 2006
+++ php-src/ext/standard/tests/array/bug35014_64bit.phptMon Jun  4 
01:23:22 2007
@@ -42,5 +42,5 @@
 int(9)
 float(1)
 int(99980001)
-float(2.8404260053903E+20)
-int(8589934590)
+float(1.219953680145E+30)
+float(3.6893488147419E+19)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug23894.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/standard/tests/strings/bug23894.phpt
diff -u php-src/ext/standard/tests/strings/bug23894.phpt:1.3 
php-src/ext/standard/tests/strings/bug23894.phpt:1.4
--- php-src/ext/standard/tests/strings/bug23894.phpt:1.3Mon Dec 25 
11:16:05 2006
+++ php-src/ext/standard/tests/strings/bug23894.phptMon Jun  4 01:23:22 2007
@@ -8,13 +8,13 @@
 $test = sprintf(% 13u, $a);
 var_dump($test, bin2hex((binary)$test));
 ?
---EXPECT--
-string(4) -012
-string(8) 2d303132
-string(13)4294967284
-string(26) 20202034323934393637323834
---UEXPECT--
-unicode(4) -012
-unicode(8) 2d303132
-unicode(13)4294967284
-unicode(26) 20202034323934393637323834
+--EXPECTREGEX--
+string\(4\) \-012\
+string\(8\) \2d303132\
+(string\(13\) \   4294967284\|string\(20\) \18446744073709551604\)
+(string\(26\) \20202034323934393637323834\|string\(40\) 
\3138343436373434303733373039353531363034\)
+--UEXPECTREGEX--
+unicode\(4\) \-012\
+unicode\(8\) \2d303132\
+(unicode\(13\) \   4294967284\|unicode\(20\) \18446744073709551604\)
+(unicode\(26\) \20202034323934393637323834\|unicode\(40\) 
\3138343436373434303733373039353531363034\)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug26973.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/standard/tests/strings/bug26973.phpt
diff -u php-src/ext/standard/tests/strings/bug26973.phpt:1.3 
php-src/ext/standard/tests/strings/bug26973.phpt:1.4
--- php-src/ext/standard/tests/strings/bug26973.phpt:1.3Mon May 17 
20:58:57 2004
+++ php-src/ext/standard/tests/strings/bug26973.phptMon Jun  4 01:23:22 2007
@@ -18,17 +18,17 @@
 printf(%05u\n, -200);
 
 ?
---EXPECT--
-+0200
--0200
-+200.00
--200.00
+--EXPECTREGEX--
+\+0200
+\-0200
+\+200\.00
+\-200\.00
 00200
-4294967096
+(4294967096|18446744073709551416)
 ---
 00200
--0200
-200.00
--200.00
+\-0200
+200\.00
+\-200\.00
 00200
-4294967096
+(4294967096|18446744073709551416)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/printf_64bit.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/standard/tests/strings/printf_64bit.phpt
diff -u php-src/ext/standard/tests/strings/printf_64bit.phpt:1.4 
php-src/ext/standard/tests/strings/printf_64bit.phpt:1.5
--- php-src/ext/standard/tests/strings/printf_64bit.phpt:1.4Mon May  7 
21:38:35 2007
+++ php-src/ext/standard/tests/strings/printf_64bit.phptMon Jun  4 
01:23:22 2007
@@ -531,11 +531,11 @@
 
 0
 1
-4294967295
+18446744073709551615
 2
-4294967294
+18446744073709551614
 2333
-4271633963
+18446744073686218283
 1234
 
 *** Output for octal type ***
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/sprintf_f_2.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/standard/tests/strings/sprintf_f_2.phpt
diff -u php-src/ext/standard/tests/strings/sprintf_f_2.phpt:1.4 
php-src/ext/standard/tests/strings/sprintf_f_2.phpt:1.5
--- php-src/ext/standard/tests/strings/sprintf_f_2.phpt:1.4 Mon May  7 
22:33:39 2007
+++ php-src/ext/standard/tests/strings/sprintf_f_2.phpt Mon Jun  4 01:23:22 2007
@@ -80,71 +80,71 @@
  
 var_dump(sprintf(%.3e, $number)); // outputs 3.63e+8
 ?
---EXPECT--
-string(7) 100.426
-string(6) 100.43
-string(3) 100
-string(3) 100
-string(3) 144
-string(3) 144
-string(34) There are 100 monkeys in the world
-string(28) The 100.1 contains 0 monkeys
-string(30) The world contains 100 monkeys
-string(76) The world contains 100 monkeys.
-That's a nice world full of 100 monkeys.
-string(33) %b = '1010001010011010101101'
-string(8) %c = 'A'
-string(15) %d = '43951789'
-string(18) %e = '4.395179e+7'
-string(15) %u = '43951789'
-string(17) %u = '4251015507'
-string(22) %f = '43951789.00'
-string(16) %o = '247523255'
-string(15) %s = '43951789'
-string(14) %x = '29ea6ad'
-string(14) %X = '29EA6AD'
-string(17) %+d = 

Re: [PHP-CVS] cvs: php-src /ext/standard formatted_print.c

2007-06-03 Thread Brian Shire


Yep, I think tests/strings/printf_64bit.phpt should actually cover  
this one though (once I commit the changes to fix these tests I  
broke).  Let me know if you  need any more specific tests though,  
basically printf(%u, -1) is now 18446744073709551615 rather than  
4294967295 on 64-bit.


On Jun 3, 2007, at 8:06 AM, Ilia Alshanetsky wrote:


Brian,

Can you please add a test case.

Thanks,

Ilia

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



- Shire
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-CVS] cvs: php-src(PHP_5_2) /main output.c

2007-04-15 Thread Brian Shire
shire   Mon Apr 16 02:25:24 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main   output.c 
  Log:
  fix fold typo
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/output.c?r1=1.167.2.3.2.2r2=1.167.2.3.2.3diff_format=u
Index: php-src/main/output.c
diff -u php-src/main/output.c:1.167.2.3.2.2 php-src/main/output.c:1.167.2.3.2.3
--- php-src/main/output.c:1.167.2.3.2.2 Mon Jan 29 11:21:31 2007
+++ php-src/main/output.c   Mon Apr 16 02:25:24 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: output.c,v 1.167.2.3.2.2 2007/01/29 11:21:31 dmitry Exp $ */
+/* $Id: output.c,v 1.167.2.3.2.3 2007/04/16 02:25:24 shire Exp $ */
 
 #include php.h
 #include ext/standard/head.h
@@ -112,7 +112,7 @@
 /* }}} */
 
 
-/* {{{ php_body_wirte
+/* {{{ php_body_write
  * Write body part */
 PHPAPI int php_body_write(const char *str, uint str_length TSRMLS_DC)
 {
@@ -120,7 +120,7 @@
 }
 /* }}} */
 
-/* {{{ php_header_wirte
+/* {{{ php_header_write
  * Write HTTP header */
 PHPAPI int php_header_write(const char *str, uint str_length TSRMLS_DC)
 {

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/strings pack.phpt

2007-04-12 Thread Brian Shire
shire   Fri Apr 13 02:15:07 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/strings pack.phpt 
  Log:
  reverting incorrect changes to pack test
  # only a problem on darwin, latest gcc-4.2 branch works as expected.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/pack.phpt?r1=1.1.2.3r2=1.1.2.4diff_format=u
Index: php-src/ext/standard/tests/strings/pack.phpt
diff -u php-src/ext/standard/tests/strings/pack.phpt:1.1.2.3 
php-src/ext/standard/tests/strings/pack.phpt:1.1.2.4
--- php-src/ext/standard/tests/strings/pack.phpt:1.1.2.3Tue Apr  3 
19:50:40 2007
+++ php-src/ext/standard/tests/strings/pack.phptFri Apr 13 02:15:07 2007
@@ -145,7 +145,7 @@
 )
 Array
 (
-[1] = -1
+[1] = 0
 )
 Array
 (
@@ -185,7 +185,7 @@
 )
 Array
 (
-[1] = -1
+[1] = 0
 )
 Array
 (
@@ -233,7 +233,7 @@
 )
 Array
 (
-[1] = -1
+[1] = 0
 )
 Array
 (
@@ -305,7 +305,7 @@
 )
 Array
 (
-[1] = -1
+[1] = 0
 )
 Array
 (

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



[PHP-CVS] cvs: php-src /ext/standard/tests/strings pack.phpt

2007-04-12 Thread Brian Shire
shire   Fri Apr 13 02:15:13 2007 UTC

  Modified files:  
/php-src/ext/standard/tests/strings pack.phpt 
  Log:
  MFB: reverting incorrect changes to pack test
  # only a problem on darwin, latest gcc-4.2 branch works as expected.
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/pack.phpt?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/standard/tests/strings/pack.phpt
diff -u php-src/ext/standard/tests/strings/pack.phpt:1.4 
php-src/ext/standard/tests/strings/pack.phpt:1.5
--- php-src/ext/standard/tests/strings/pack.phpt:1.4Tue Apr  3 19:50:43 2007
+++ php-src/ext/standard/tests/strings/pack.phptFri Apr 13 02:15:12 2007
@@ -145,7 +145,7 @@
 )
 Array
 (
-[1] = -1
+[1] = 0
 )
 Array
 (
@@ -185,7 +185,7 @@
 )
 Array
 (
-[1] = -1
+[1] = 0
 )
 Array
 (
@@ -233,7 +233,7 @@
 )
 Array
 (
-[1] = -1
+[1] = 0
 )
 Array
 (
@@ -305,7 +305,7 @@
 )
 Array
 (
-[1] = -1
+[1] = 0
 )
 Array
 (

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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard pack.c /ext/standard/tests/strings pack.phpt

2007-04-12 Thread Brian Shire


FYI: Reverted my bad pack test changes, just verified that the latest  
gcc-4.2 branch on Darwin returns 0 rather than -1 for the following  
code:


#include stdio.h

int main() {
double foo = (double)4294967296LL;
printf(%d\n, (unsigned long)(foo));
}

- Shire
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard pack.c /ext/standard/tests/strings pack.phpt

2007-04-10 Thread Brian Shire


Yeah, discussed briefly with Jani and Ilia.  I can revert it (or  
temporarily remove those lines of the test) until I can figure out  
why this doesn't work on Linux if you like?  On Darwin the code intval 
(4294967296) will return -1, while on other systems it appears to be  
0.  I can reproduce this on the C level by replicating the double- 
long cast that's happening within PHP.  Any suggestions on this  
would be welcome.


Antony, you said below that you tested on PPC?  Seems like this is a  
Darwin specific problem then (I tested on Darwin/Intel), perhaps I  
should just remove those tests for Darwin for the time being?


Thanks,

-shire

On Apr 10, 2007, at 2:34 PM, Antony Dovgal wrote:


On 04/03/2007 11:50 PM, Brian Shire wrote:

shire   Tue Apr  3 19:50:40 2007 UTC
  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard	pack.c /php-src/ext/standard/tests/ 
strings	pack.phpt   Log:
  correction for previous fix to bug #38770 (pack/unpack is broken  
on 64bit)

  fix pack test, correct space to tabs


Brian, this breaks the test on Linux/FreeBSD i386.
Though somehow it's working on Mac/PPC.

diff -u php-src/ext/standard/tests/strings/pack.phpt:1.1.2.2 php- 
src/ext/standard/tests/strings/pack.phpt:1.1.2.3
--- php-src/ext/standard/tests/strings/pack.phpt:1.1.2.2	Sat Dec  
30 02:00:51 2006
+++ php-src/ext/standard/tests/strings/pack.phpt	Tue Apr  3  
19:50:40 2007

@@ -145,7 +145,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (
@@ -185,7 +185,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (
@@ -233,7 +233,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (
@@ -305,7 +305,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (



--
Wbr, Antony Dovgal


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



Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard pack.c /ext/standard/tests/strings pack.phpt

2007-04-10 Thread Brian Shire


On Apr 10, 2007, at 3:56 PM, Antony Dovgal wrote:


On 04/11/2007 02:45 AM, Brian Shire wrote:
Yeah, discussed briefly with Jani and Ilia.  I can revert it (or   
temporarily remove those lines of the test) until I can figure  
out  why this doesn't work on Linux if you like?  On Darwin the  
code intval (4294967296) will return -1, while on other systems it  
appears to be  0.  I can reproduce this on the C level by  
replicating the double-  long cast that's happening within PHP.   
Any suggestions on this  would be welcome.


Well, if it's just this Darwin/Intel difference then it's not that  
critical, I believe.
Antony, you said below that you tested on PPC?  Seems like this is  
a  Darwin specific problem then (I tested on Darwin/Intel),  
perhaps I  should just remove those tests for Darwin for the time  
being?


Let me see if I can reproduce it on Darwin/Intel, that'll take some  
time..




Thanks, I can reproduce and so can Ilia on Darwin/Intel so if you're  
getting a -1 on Darwin/PPC too then it tells me it's probably some  
silly Darwin difference/bug rather than a 64-bit extension problem on  
the Intel 2 Duo chips.  If someone has Linux/non-Darwin OS on an  
Intel 2 Duo chip that would be informative as well.



- Shire
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard pack.c /ext/standard/tests/strings pack.phpt

2007-04-03 Thread Brian Shire
shire   Tue Apr  3 19:50:40 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   pack.c 
/php-src/ext/standard/tests/strings pack.phpt 
  Log:
  correction for previous fix to bug #38770 (pack/unpack is broken on 64bit)
  fix pack test, correct space to tabs
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/pack.c?r1=1.57.2.5.2.3r2=1.57.2.5.2.4diff_format=u
Index: php-src/ext/standard/pack.c
diff -u php-src/ext/standard/pack.c:1.57.2.5.2.3 
php-src/ext/standard/pack.c:1.57.2.5.2.4
--- php-src/ext/standard/pack.c:1.57.2.5.2.3Sat Feb 24 02:17:27 2007
+++ php-src/ext/standard/pack.c Tue Apr  3 19:50:40 2007
@@ -15,7 +15,7 @@
| Author: Chris Schneider [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: pack.c,v 1.57.2.5.2.3 2007/02/24 02:17:27 helly Exp $ */
+/* $Id: pack.c,v 1.57.2.5.2.4 2007/04/03 19:50:40 shire Exp $ */
 
 #include php.h
 
@@ -760,7 +760,7 @@
issigned = 
input[inputpos + (machine_little_endian ? (sizeof(int) - 1) : 0)]  0x80;
} else if (sizeof(long)  4  
(input[inputpos + machine_endian_long_map[3]]  0x80) == 0x80) {
v = ~INT_MAX;
-}
+   }
 
v |= 
php_unpack(input[inputpos], sizeof(int), issigned, int_map);
add_assoc_long(return_value, n, 
v);
@@ -775,15 +775,17 @@
int *map = 
machine_endian_long_map;
long v = 0;
 
-   if (type == 'l') {
+   if (type == 'l' || type == 'L') 
{
issigned = 
input[inputpos + (machine_little_endian ? 3 : 0)]  0x80;
} else if (type == 'N') {
+   issigned = 
input[inputpos]  0x80;
map = 
big_endian_long_map;
} else if (type == 'V') {
+   issigned = 
input[inputpos + 3]  0x80;
map = 
little_endian_long_map;
}
 
-   if (sizeof(long)  4  
(input[inputpos + machine_endian_long_map[3]]  0x80) == 0x80) {
+   if (sizeof(long)  4  
issigned) {
v = ~INT_MAX;
}
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/pack.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/standard/tests/strings/pack.phpt
diff -u php-src/ext/standard/tests/strings/pack.phpt:1.1.2.2 
php-src/ext/standard/tests/strings/pack.phpt:1.1.2.3
--- php-src/ext/standard/tests/strings/pack.phpt:1.1.2.2Sat Dec 30 
02:00:51 2006
+++ php-src/ext/standard/tests/strings/pack.phptTue Apr  3 19:50:40 2007
@@ -145,7 +145,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (
@@ -185,7 +185,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (
@@ -233,7 +233,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (
@@ -305,7 +305,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (

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



[PHP-CVS] cvs: php-src /ext/standard pack.c /ext/standard/tests/strings pack.phpt

2007-04-03 Thread Brian Shire
shire   Tue Apr  3 19:50:43 2007 UTC

  Modified files:  
/php-src/ext/standard   pack.c 
/php-src/ext/standard/tests/strings pack.phpt 
  Log:
  MFB: correction for previous fix to bug #38770 (pack/unpack is broken on 
64bit)
  fix pack test, correct space to tabs
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/pack.c?r1=1.66r2=1.67diff_format=u
Index: php-src/ext/standard/pack.c
diff -u php-src/ext/standard/pack.c:1.66 php-src/ext/standard/pack.c:1.67
--- php-src/ext/standard/pack.c:1.66Sat Feb 24 16:25:55 2007
+++ php-src/ext/standard/pack.c Tue Apr  3 19:50:43 2007
@@ -15,7 +15,7 @@
| Author: Chris Schneider [EMAIL PROTECTED]  |
+--+
  */
-/* $Id: pack.c,v 1.66 2007/02/24 16:25:55 helly Exp $ */
+/* $Id: pack.c,v 1.67 2007/04/03 19:50:43 shire Exp $ */
 
 #include php.h
 
@@ -738,7 +738,7 @@
issigned = 
input[inputpos + (machine_little_endian ? (sizeof(int) - 1) : 0)]  0x80;
} else if (sizeof(long)  4  
(input[inputpos + machine_endian_long_map[3]]  0x80) == 0x80) {
v = ~INT_MAX;
-}
+   }
 
v |= 
php_unpack(input[inputpos], sizeof(int), issigned, int_map);
add_assoc_long(return_value, n, 
v);
@@ -753,15 +753,17 @@
int *map = 
machine_endian_long_map;
long v = 0;
 
-   if (type == 'l') {
+   if (type == 'l' || type == 'L') 
{
issigned = 
input[inputpos + (machine_little_endian ? 3 : 0)]  0x80;
} else if (type == 'N') {
+   issigned = 
input[inputpos]  0x80;
map = 
big_endian_long_map;
} else if (type == 'V') {
+   issigned = 
input[inputpos + 3]  0x80;
map = 
little_endian_long_map;
}
 
-   if (sizeof(long)  4  
(input[inputpos + machine_endian_long_map[3]]  0x80) == 0x80) {
+   if (sizeof(long)  4  
issigned) {
v = ~INT_MAX;
}
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/pack.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/standard/tests/strings/pack.phpt
diff -u php-src/ext/standard/tests/strings/pack.phpt:1.3 
php-src/ext/standard/tests/strings/pack.phpt:1.4
--- php-src/ext/standard/tests/strings/pack.phpt:1.3Sat Dec 30 02:01:09 2006
+++ php-src/ext/standard/tests/strings/pack.phptTue Apr  3 19:50:43 2007
@@ -145,7 +145,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (
@@ -185,7 +185,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (
@@ -233,7 +233,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (
@@ -305,7 +305,7 @@
 )
 Array
 (
-[1] = 0
+[1] = -1
 )
 Array
 (

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



[PHP-CVS] cvs: php-src /ext/standard array.c /ext/standard/tests/array bug30074.phpt

2006-12-19 Thread Brian Shire
shire   Tue Dec 19 08:02:48 2006 UTC

  Modified files:  
/php-src/ext/standard   array.c 
/php-src/ext/standard/tests/array   bug30074.phpt 
  Log:
  -Fixed bug #30074 (apparent symbol table error with extract($blah, 
EXTR_REFS)) 
  # appoligies, I did this in reverse (applied to PHP_5_2) I should have MFH.  
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.397r2=1.398diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.397 php-src/ext/standard/array.c:1.398
--- php-src/ext/standard/array.c:1.397  Wed Dec  6 17:42:47 2006
+++ php-src/ext/standard/array.cTue Dec 19 08:02:48 2006
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.397 2006/12/06 17:42:47 tony2001 Exp $ */
+/* $Id: array.c,v 1.398 2006/12/19 08:02:48 shire Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1492,7 +1492,7 @@
 
*orig_var = *entry;
} else {
-   if (var_array-refcount  1) {
+   if (var_array-refcount  1 || *entry 
== EG(uninitialized_zval_ptr)) {

SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
} else {
(*entry)-is_ref = 1;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug30074.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/standard/tests/array/bug30074.phpt
diff -u /dev/null php-src/ext/standard/tests/array/bug30074.phpt:1.2
--- /dev/null   Tue Dec 19 08:02:48 2006
+++ php-src/ext/standard/tests/array/bug30074.phpt  Tue Dec 19 08:02:48 2006
@@ -0,0 +1,15 @@
+--TEST--
+Bug #30074 (EG(uninitialized_zval_ptr) gets set to reference using EXTR_REFS, 
affecting later values)
+--FILE--
+?php
+error_reporting(E_ALL  ~E_NOTICE);   // We don't want the notice for 
$undefined
+$result = extract(array('a'=$undefined), EXTR_REFS); 
+var_dump(array($a));
+echo Done\n;
+?
+--EXPECT--
+array(1) {
+  [0]=
+  NULL
+}
+Done

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS

2006-12-19 Thread Brian Shire
shire   Tue Dec 19 08:18:48 2006 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
  Log:
  BFN 
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.439r2=1.2027.2.547.2.440diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.439 php-src/NEWS:1.2027.2.547.2.440
--- php-src/NEWS:1.2027.2.547.2.439 Mon Dec 18 17:56:25 2006
+++ php-src/NEWSTue Dec 19 08:18:47 2006
@@ -204,6 +204,8 @@
 - Fixed bug #36644 (possible crash in variant_date_from_timestamp()). (Ilia)
 - Fixed bug #33282 (Re-assignment by reference does not clear the is_ref flag)
   (Ilia,Dmitry, Matt Wilmas)
+- Fixed bug #30074 (apparent symbol table error with extract($blah, 
EXTR_REFS)) 
+  (shire)
 - Fixed bug #29840 (is_executable() does not honor safe_mode_exec_dir
   setting). (Ilia)
 

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard array.c /ext/standard/tests/array bug30074.phpt

2006-12-17 Thread Brian Shire
shire   Sun Dec 17 20:09:48 2006 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/array   bug30074.phpt 

  Modified files:  
/php-src/ext/standard   array.c 
  Log:
  Fixed bug #30074
extract with EXTR_REFS was setting EG(unitialized_zval_ptr)-is_ref=1, 
affecting subsequent usage
Added test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.20r2=1.308.2.21.2.21diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.20 
php-src/ext/standard/array.c:1.308.2.21.2.21
--- php-src/ext/standard/array.c:1.308.2.21.2.20Sun Dec 10 19:43:03 2006
+++ php-src/ext/standard/array.cSun Dec 17 20:09:48 2006
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.20 2006/12/10 19:43:03 iliaa Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.21 2006/12/17 20:09:48 shire Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -1436,7 +1436,7 @@
 
*orig_var = *entry;
} else {
-   if ((*var_array)-refcount  1) 
{
+   if ((*var_array)-refcount  1 
|| *entry == EG(uninitialized_zval_ptr)) {

SEPARATE_ZVAL_TO_MAKE_IS_REF(entry);
} else {
(*entry)-is_ref = 1;

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug30074.phpt?view=markuprev=1.1
Index: php-src/ext/standard/tests/array/bug30074.phpt
+++ php-src/ext/standard/tests/array/bug30074.phpt

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