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

2009-06-26 Thread Matt Wilmas
mattwil Fri Jun 26 12:24:21 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  Typo, capitalization, wording
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.652r2=1.2027.2.547.2.965.2.653diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.652 
php-src/NEWS:1.2027.2.547.2.965.2.653
--- php-src/NEWS:1.2027.2.547.2.965.2.652   Fri Jun 26 09:32:54 2009
+++ php-src/NEWSFri Jun 26 12:24:20 2009
@@ -126,7 +126,7 @@
 - Improved Windows support:
   . Update all libraries to their latest stable version. (Pierre, Rob, Liz, 
 Garrett).
-  . Addes Windows support for stat(), touch(), filemtime(), filesize() and
+  . Added Windows support for stat(), touch(), filemtime(), filesize() and
 related functions. (Pierre)
   . Re-added socket_create_pair() for Windows in sockets extension. (Kalle)
   . Added inet_pton() and inet_ntop() also for Windows platforms. (Kalle)
@@ -146,13 +146,13 @@
   . Added Windows support for stream_socket_pair(). (Kalle)
   . Drop all external dependencies for the core features. (Pierre)
   . Drastically improve the build procedure (Pierre, Kalle, Rob):
-. VC9 (visual c++ 2008) or later support
+. VC9 (Visual C++ 2008) or later support
 . Initial experimental x64 support
-  . MSI installer now supports all recent windows, incl. Win7. 
-(John, Kanwaljeet Singla)
+  . MSI installer now supports all recent Windows versions, including
+Windows 7. (John, Kanwaljeet Singla)
 
 - Improved and cleaned CGI code:
-  . FastCGI is now always enabled and can not be disabled.
+  . FastCGI is now always enabled and cannot be disabled.
 See sapi/cgi/CHANGES for more details. (Dmitry)
   . Added CGI SAPI -T option which can be used to measure execution
 time of script repeated several times. (Dmitry)



-- 
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) / UPGRADING

2009-06-25 Thread Matt Wilmas
mattwil Thu Jun 25 13:00:08 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcUPGRADING 
  Log:
  Fix example - it means what it says
  
http://cvs.php.net/viewvc.cgi/php-src/UPGRADING?r1=1.1.2.3.2.1.2.23r2=1.1.2.3.2.1.2.24diff_format=u
Index: php-src/UPGRADING
diff -u php-src/UPGRADING:1.1.2.3.2.1.2.23 php-src/UPGRADING:1.1.2.3.2.1.2.24
--- php-src/UPGRADING:1.1.2.3.2.1.2.23  Thu Jun 25 10:41:07 2009
+++ php-src/UPGRADING   Thu Jun 25 13:00:08 2009
@@ -1,4 +1,4 @@
-$Id: UPGRADING,v 1.1.2.3.2.1.2.23 2009/06/25 10:41:07 gwynne Exp $
+$Id: UPGRADING,v 1.1.2.3.2.1.2.24 2009/06/25 13:00:08 mattwil Exp $
 
 UPGRADE NOTES - PHP 5.3
 
@@ -285,7 +285,7 @@
   Static HEREDOCs can be used to initialize static variables and class members
   or constants:
 
-  static $foo = 'LABEL'
+  static $foo = LABEL
   No variables here...
   LABEL;
 



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



Re: [PHP-CVS] cvs: php-src / README.PARAMETER_PARSING_API /win32/build config.w32 ZendEngine2 Zend.m4 zend_API.c zend_compile.c zend_execute.c zend_execute_API.c zend_operators.c zend_operators.h ze

2009-06-08 Thread Matt Wilmas

Hi Antony, Lukas,

- Original Message -
From: Lukas Kahwe Smith
Sent: Monday, June 08, 2009



On 08.06.2009, at 09:26, Antony Dovgal wrote:


On 05.06.2009 21:15, Matt Wilmas wrote:

ext/standard/tests/strings/chunk_split_variation2.phpt
ext/standard/tests/strings/chunk_split_variation5.phpt
ext/standard/tests/strings/chunk_split_variation8.phpt


It looks like these should also be failing with 5.2 on 64-bit?


Well, they don't.


Do you have the diffs to show?  Thanks.  Comment below...


I'll leave
them as-is for now then...  Some options:

Skip them on 64-bit?  variation2 could have a 64-bit version added.
variation5/8 look like the same thing (and don't get why they  reference 
Bug
#42796).  Their logic for the test value (PHP_INT_MAX * 3) is  flawed 
anyway
with the old (err, formerly new) double-long conversion method,  but 
that

could be changed to get the same result cross-platform...



Sounds like we have a BC issue?


Nah, just something isolated with these tests it seems.  (All other tests 
are presumably fine.)


The double-int conversion method on 64-bit is exactly the same as 5.2, 
so...


Looking at those chunk_split() tests quickly again, variation2 is the same 
in 5.2 and 5.3 for anything related to dval-lval conversion.  And the 
duplicate variation5/8, I do see now why the one iteration would fail on 
64-bit (if that's the only part failing).  However, on those 2 tests, I 
think it's *not possible* for it to pass with 5.2 on 64-bit (at the same 
iteration).  No way, AFAICT. :-/



regards,
Lukas Kahwe Smith
m...@pooteeweet.org


- Matt 



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



[PHP-CVS] cvs: php-src /tests/classes __call_005.phpt __call_007.phpt ZendEngine2 zend_compile.c zend_vm_def.h zend_vm_execute.h ZendEngine2/tests call_static_006.phpt magic_methods_002.phpt magic_m

2009-06-07 Thread Matt Wilmas
mattwil Sun Jun  7 15:45:47 2009 UTC

  Modified files:  
/ZendEngine2zend_compile.c zend_vm_def.h zend_vm_execute.h 
/ZendEngine2/tests  call_static_006.phpt magic_methods_002.phpt 
magic_methods_003.phpt magic_methods_004.phpt 
magic_methods_005.phpt magic_methods_007.phpt 
magic_methods_008.phpt magic_methods_010.phpt 
/php-src/tests/classes  __call_005.phpt __call_007.phpt 
  Log:
  Changed error messages to use cannot instead of can not (meaning also 
can)
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.860r2=1.861diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.860 ZendEngine2/zend_compile.c:1.861
--- ZendEngine2/zend_compile.c:1.860Thu Jun  4 18:18:46 2009
+++ ZendEngine2/zend_compile.c  Sun Jun  7 15:45:46 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_compile.c,v 1.860 2009/06/04 18:18:46 mattwil Exp $ */
+/* $Id: zend_compile.c,v 1.861 2009/06/07 15:45:46 mattwil Exp $ */
 
 #include zend_language_parser.h
 #include zend.h
@@ -1273,7 +1273,7 @@
if (CG(active_class_entry)-ce_flags  ZEND_ACC_INTERFACE) {
if ((lcname_len == sizeof(ZEND_CALL_FUNC_NAME)-1)  
(ZEND_U_EQUAL(Z_TYPE(function_name-u.constant), lcname, lcname_len, 
ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1))) {
if (fn_flags  ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_COMPILE_ERROR, The magic 
method __call() must have public visibility and can not be static);
+   zend_error(E_COMPILE_ERROR, The magic 
method __call() must have public visibility and cannot be static);
}
} else if ((lcname_len == 
sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1)  
(ZEND_U_EQUAL(Z_TYPE(function_name-u.constant), lcname, lcname_len, 
ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1))) {
if ((fn_flags  (ZEND_ACC_PPP_MASK ^ 
ZEND_ACC_PUBLIC)) || (fn_flags  ZEND_ACC_STATIC) == 0) {
@@ -1281,23 +1281,23 @@
}
} else if ((lcname_len == sizeof(ZEND_GET_FUNC_NAME)-1) 
 (ZEND_U_EQUAL(Z_TYPE(function_name-u.constant), lcname, lcname_len, 
ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)-1))) {
if (fn_flags  ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_COMPILE_ERROR, The magic 
method __get() must have public visibility and can not be static);
+   zend_error(E_COMPILE_ERROR, The magic 
method __get() must have public visibility and cannot be static);
}
} else if ((lcname_len == sizeof(ZEND_SET_FUNC_NAME)-1) 
 (ZEND_U_EQUAL(Z_TYPE(function_name-u.constant), lcname, lcname_len, 
ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)-1))) {
if (fn_flags  ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_COMPILE_ERROR, The magic 
method __set() must have public visibility and can not be static);
+   zend_error(E_COMPILE_ERROR, The magic 
method __set() must have public visibility and cannot be static);
}
} else if ((lcname_len == 
sizeof(ZEND_UNSET_FUNC_NAME)-1)  
(ZEND_U_EQUAL(Z_TYPE(function_name-u.constant), lcname, lcname_len, 
ZEND_UNSET_FUNC_NAME, sizeof(ZEND_UNSET_FUNC_NAME)-1))) {
if (fn_flags  ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_COMPILE_ERROR, The magic 
method __unset() must have public visibility and can not be static);
+   zend_error(E_COMPILE_ERROR, The magic 
method __unset() must have public visibility and cannot be static);
}
} else if ((lcname_len == 
sizeof(ZEND_ISSET_FUNC_NAME)-1)  
(ZEND_U_EQUAL(Z_TYPE(function_name-u.constant), lcname, lcname_len, 
ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME)-1))) {
if (fn_flags  ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_COMPILE_ERROR, The magic 
method __isset() must have public visibility and can not be static);
+   zend_error(E_COMPILE_ERROR, The magic 
method __isset() must have public visibility and cannot be static);
}
} else if ((lcname_len == 
sizeof(ZEND_TOSTRING_FUNC_NAME)-1)  

[PHP-CVS] cvs: php-src(PHP_5_3) /tests/classes __call_005.phpt __call_007.phpt ZendEngine2 zend_compile.c zend_vm_def.h zend_vm_execute.h ZendEngine2/tests call_static_006.phpt magic_methods_002.php

2009-06-07 Thread Matt Wilmas
mattwil Sun Jun  7 15:46:58 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/ZendEngine2zend_compile.c zend_vm_def.h zend_vm_execute.h 
/ZendEngine2/tests  call_static_006.phpt magic_methods_002.phpt 
magic_methods_003.phpt magic_methods_004.phpt 
magic_methods_005.phpt magic_methods_007.phpt 
magic_methods_008.phpt magic_methods_010.phpt 
/php-src/tests/classes  __call_005.phpt __call_007.phpt 
  Log:
  MFH: Changed error messages to use cannot instead of can not (meaning 
also can)
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.647.2.27.2.41.2.108r2=1.647.2.27.2.41.2.109diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.108 
ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.109
--- ZendEngine2/zend_compile.c:1.647.2.27.2.41.2.108Thu Jun  4 18:20:42 2009
+++ ZendEngine2/zend_compile.c  Sun Jun  7 15:46:51 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.108 2009/06/04 18:20:42 mattwil Exp 
$ */
+/* $Id: zend_compile.c,v 1.647.2.27.2.41.2.109 2009/06/07 15:46:51 mattwil Exp 
$ */
 
 #include zend_language_parser.h
 #include zend.h
@@ -1211,7 +1211,7 @@
if (CG(active_class_entry)-ce_flags  ZEND_ACC_INTERFACE) {
if ((name_len == sizeof(ZEND_CALL_FUNC_NAME)-1)  
(!memcmp(lcname, ZEND_CALL_FUNC_NAME, sizeof(ZEND_CALL_FUNC_NAME)-1))) {
if (fn_flags  ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_WARNING, The magic method 
__call() must have public visibility and can not be static);
+   zend_error(E_WARNING, The magic method 
__call() must have public visibility and cannot be static);
}
} else if ((name_len == 
sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1)  (!memcmp(lcname, 
ZEND_CALLSTATIC_FUNC_NAME, sizeof(ZEND_CALLSTATIC_FUNC_NAME)-1))) {
if ((fn_flags  (ZEND_ACC_PPP_MASK ^ 
ZEND_ACC_PUBLIC)) || (fn_flags  ZEND_ACC_STATIC) == 0) {
@@ -1219,23 +1219,23 @@
}
} else if ((name_len == sizeof(ZEND_GET_FUNC_NAME)-1) 
 (!memcmp(lcname, ZEND_GET_FUNC_NAME, sizeof(ZEND_GET_FUNC_NAME)-1))) {
if (fn_flags  ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_WARNING, The magic method 
__get() must have public visibility and can not be static);
+   zend_error(E_WARNING, The magic method 
__get() must have public visibility and cannot be static);
}
} else if ((name_len == sizeof(ZEND_SET_FUNC_NAME)-1) 
 (!memcmp(lcname, ZEND_SET_FUNC_NAME, sizeof(ZEND_SET_FUNC_NAME)-1))) {
if (fn_flags  ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_WARNING, The magic method 
__set() must have public visibility and can not be static);
+   zend_error(E_WARNING, The magic method 
__set() must have public visibility and cannot be static);
}
} else if ((name_len == sizeof(ZEND_UNSET_FUNC_NAME)-1) 
 (!memcmp(lcname, ZEND_UNSET_FUNC_NAME, sizeof(ZEND_UNSET_FUNC_NAME)-1))) {
if (fn_flags  ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_WARNING, The magic method 
__unset() must have public visibility and can not be static);
+   zend_error(E_WARNING, The magic method 
__unset() must have public visibility and cannot be static);
}
} else if ((name_len == sizeof(ZEND_ISSET_FUNC_NAME)-1) 
 (!memcmp(lcname, ZEND_ISSET_FUNC_NAME, sizeof(ZEND_ISSET_FUNC_NAME)-1))) {
if (fn_flags  ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_WARNING, The magic method 
__isset() must have public visibility and can not be static);
+   zend_error(E_WARNING, The magic method 
__isset() must have public visibility and cannot be static);
}
} else if ((name_len == 
sizeof(ZEND_TOSTRING_FUNC_NAME)-1)  (!memcmp(lcname, ZEND_TOSTRING_FUNC_NAME, 
sizeof(ZEND_TOSTRING_FUNC_NAME)-1))) {
if (fn_flags  ((ZEND_ACC_PPP_MASK | 
ZEND_ACC_STATIC) ^ ZEND_ACC_PUBLIC)) {
-   zend_error(E_WARNING, 

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

2009-06-07 Thread Matt Wilmas
mattwil Sun Jun  7 19:28:15 2009 UTC

  Added files: (Branch: PHP_5_3)
/ZendEngine2/tests  bug47836.phpt 

  Modified files:  
/ZendEngine2zend_hash.c 
/php-src/ext/standard/tests/array   array_push_error2.phpt 
  Log:
  MFH: Fixed bug #47836 (array operator [] inconsistency when the array has 
PHP_INT_MAX index value)
  Also simplified related array_push() test
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_hash.c?r1=1.121.2.4.2.8.2.8r2=1.121.2.4.2.8.2.9diff_format=u
Index: ZendEngine2/zend_hash.c
diff -u ZendEngine2/zend_hash.c:1.121.2.4.2.8.2.8 
ZendEngine2/zend_hash.c:1.121.2.4.2.8.2.9
--- ZendEngine2/zend_hash.c:1.121.2.4.2.8.2.8   Wed Dec 31 11:15:32 2008
+++ ZendEngine2/zend_hash.c Sun Jun  7 19:28:15 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_hash.c,v 1.121.2.4.2.8.2.8 2008/12/31 11:15:32 sebastian Exp $ */
+/* $Id: zend_hash.c,v 1.121.2.4.2.8.2.9 2009/06/07 19:28:15 mattwil Exp $ */
 
 #include zend.h
 
@@ -376,7 +376,7 @@
UPDATE_DATA(ht, p, pData, nDataSize);
HANDLE_UNBLOCK_INTERRUPTIONS();
if ((long)h = (long)ht-nNextFreeElement) {
-   ht-nNextFreeElement = h + 1;
+   ht-nNextFreeElement = h  LONG_MAX ? h + 1 : 
LONG_MAX;
}
if (pDest) {
*pDest = p-pData;
@@ -404,7 +404,7 @@
HANDLE_UNBLOCK_INTERRUPTIONS();
 
if ((long)h = (long)ht-nNextFreeElement) {
-   ht-nNextFreeElement = h + 1;
+   ht-nNextFreeElement = h  LONG_MAX ? h + 1 : LONG_MAX;
}
ht-nNumOfElements++;
ZEND_HASH_IF_FULL_DO_RESIZE(ht);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_push_error2.phpt?r1=1.1.4.5r2=1.1.4.6diff_format=u
Index: php-src/ext/standard/tests/array/array_push_error2.phpt
diff -u php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.4.5 
php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.4.6
--- php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.4.5 Wed Mar 
19 03:15:56 2008
+++ php-src/ext/standard/tests/array/array_push_error2.phpt Sun Jun  7 
19:28:15 2009
@@ -1,5 +1,5 @@
 --TEST--
-Test array_push() function : error conditions - min and max int values as keys
+Test array_push() function : error conditions - max int value as key
 --FILE--
 ?php
 /* Prototype  : int array_push(array $stack, mixed $var [, mixed $...])
@@ -8,42 +8,27 @@
  */
 
 /*
- * Use PHP's minimum and maximum integer values as array keys
+ * Use PHP's maximum integer value as array key
  * then try and push new elements onto the array
  */
 
 echo *** Testing array_push() : error conditions ***\n;
 
-$array = array(-PHP_INT_MAX = 'min', PHP_INT_MAX = 'max');
+$array = array(PHP_INT_MAX = 'max');
 
 var_dump(array_push($array, 'new'));
 var_dump($array);
-var_dump(array_push($array, 'var'));
-var_dump($array);
 
 echo Done;
 ?
 
 --EXPECTF--
 *** Testing array_push() : error conditions ***
-int(3)
-array(3) {
-  [-%d]=
-  string(3) min
-  [%d]=
-  string(3) max
-  [-%d]=
-  string(3) new
-}
 
 Warning: array_push(): Cannot add element to the array as the next element is 
already occupied in %s on line %d
 bool(false)
-array(3) {
-  [-%d]=
-  string(3) min
+array(1) {
   [%d]=
   string(3) max
-  [-%d]=
-  string(3) new
 }
 Done
\ No newline at end of file

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug47836.phpt?view=markuprev=1.1
Index: ZendEngine2/tests/bug47836.phpt
+++ ZendEngine2/tests/bug47836.phpt
--TEST--
Bug #47836 (array operator [] inconsistency when the array has PHP_INT_MAX 
index value)
--FILE--
?php

$arr[PHP_INT_MAX] = 1;
$arr[] = 2;

var_dump($arr);
?
--EXPECTF--
Warning: Cannot add element to the array as the next element is already 
occupied in %s on line 4
array(1) {
  [%d]=
  int(1)
}



-- 
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/tests/array array_push_error2.phpt ZendEngine2 zend_hash.c ZendEngine2/tests bug47836.phpt

2009-06-07 Thread Matt Wilmas
mattwil Sun Jun  7 19:28:33 2009 UTC

  Added files: (Branch: PHP_5_2)
/ZendEngine2/tests  bug47836.phpt 

  Modified files:  
/php-srcNEWS 
/ZendEngine2zend_hash.c 
/php-src/ext/standard/tests/array   array_push_error2.phpt 
  Log:
  MFH: Fixed bug #47836 (array operator [] inconsistency when the array has 
PHP_INT_MAX index value)
  Also simplified related array_push() test
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1541r2=1.2027.2.547.2.1542diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1541 php-src/NEWS:1.2027.2.547.2.1542
--- php-src/NEWS:1.2027.2.547.2.1541Wed Jun  3 12:41:46 2009
+++ php-src/NEWSSun Jun  7 19:28:32 2009
@@ -19,6 +19,8 @@
 - Fixed bug #48273 (snmp*_real_walk() returns SNMP errors as values).
   (Ilia, lytboris at gmail dot com)
 - Fixed bug #48247 (Crash on errors during startup). (Stas)
+- Fixed bug #47836 (array operator [] inconsistency when the array has
+  PHP_INT_MAX index value). (Matt)
 - Fixed bug #46386 (Digest authentication with SOAP module fails against MSSQL 
   SOAP services). (Ilia, lordelph at gmail dot com)
 - Fixed bug #42143 (The constant NAN is reported as 0 on Windows)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_hash.c?r1=1.121.2.4.2.10r2=1.121.2.4.2.11diff_format=u
Index: ZendEngine2/zend_hash.c
diff -u ZendEngine2/zend_hash.c:1.121.2.4.2.10 
ZendEngine2/zend_hash.c:1.121.2.4.2.11
--- ZendEngine2/zend_hash.c:1.121.2.4.2.10  Wed Dec 31 11:17:33 2008
+++ ZendEngine2/zend_hash.c Sun Jun  7 19:28:32 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_hash.c,v 1.121.2.4.2.10 2008/12/31 11:17:33 sebastian Exp $ */
+/* $Id: zend_hash.c,v 1.121.2.4.2.11 2009/06/07 19:28:32 mattwil Exp $ */
 
 #include zend.h
 
@@ -376,7 +376,7 @@
UPDATE_DATA(ht, p, pData, nDataSize);
HANDLE_UNBLOCK_INTERRUPTIONS();
if ((long)h = (long)ht-nNextFreeElement) {
-   ht-nNextFreeElement = h + 1;
+   ht-nNextFreeElement = h  LONG_MAX ? h + 1 : 
LONG_MAX;
}
if (pDest) {
*pDest = p-pData;
@@ -404,7 +404,7 @@
HANDLE_UNBLOCK_INTERRUPTIONS();
 
if ((long)h = (long)ht-nNextFreeElement) {
-   ht-nNextFreeElement = h + 1;
+   ht-nNextFreeElement = h  LONG_MAX ? h + 1 : LONG_MAX;
}
ht-nNumOfElements++;
ZEND_HASH_IF_FULL_DO_RESIZE(ht);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_push_error2.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/standard/tests/array/array_push_error2.phpt
diff -u php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.2.2 
php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.2.3
--- php-src/ext/standard/tests/array/array_push_error2.phpt:1.1.2.2 Fri Mar 
14 23:13:07 2008
+++ php-src/ext/standard/tests/array/array_push_error2.phpt Sun Jun  7 
19:28:33 2009
@@ -1,9 +1,5 @@
 --TEST--
-Test array_push() function : error conditions - min and max int values as keys
---SKIPIF--
-?php
-if (PHP_INT_SIZE != 4) die(skip this test is for 32bit platform only);
-?
+Test array_push() function : error conditions - max int value as key
 --FILE--
 ?php
 /* Prototype  : int array_push(array $stack, mixed $var [, mixed $...])
@@ -12,42 +8,27 @@
  */
 
 /*
- * Use PHP's minimum and maximum integer values as array keys
+ * Use PHP's maximum integer value as array key
  * then try and push new elements onto the array
  */
 
 echo *** Testing array_push() : error conditions ***\n;
 
-$array = array(-PHP_INT_MAX = 'min', PHP_INT_MAX = 'max');
+$array = array(PHP_INT_MAX = 'max');
 
 var_dump(array_push($array, 'new'));
 var_dump($array);
-var_dump(array_push($array, 'var'));
-var_dump($array);
 
 echo Done;
 ?
 
 --EXPECTF--
 *** Testing array_push() : error conditions ***
-int(3)
-array(3) {
-  [-2147483647]=
-  string(3) min
-  [2147483647]=
-  string(3) max
-  [-2147483648]=
-  string(3) new
-}
 
 Warning: array_push(): Cannot add element to the array as the next element is 
already occupied in %s on line %d
 bool(false)
-array(3) {
-  [-2147483647]=
-  string(3) min
-  [2147483647]=
+array(1) {
+  [%d]=
   string(3) max
-  [-2147483648]=
-  string(3) new
 }
 Done

http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug47836.phpt?view=markuprev=1.1
Index: ZendEngine2/tests/bug47836.phpt
+++ ZendEngine2/tests/bug47836.phpt
--TEST--
Bug #47836 (array operator [] inconsistency when the array has PHP_INT_MAX 
index value)
--FILE--
?php

$arr[PHP_INT_MAX] = 1;
$arr[] = 2;

var_dump($arr);
?
--EXPECTF--
Warning: Cannot add element to the array as the next element is already 
occupied in %s on line 4
array(1) {
  [%d]=
  int(1)
}



-- 
PHP CVS Mailing List (http://www.php.net/)
To 

[PHP-CVS] cvs: php-src /ext/standard/tests/array array_slice_variation2.phpt array_slice_variation3.phpt /ext/standard/tests/math decbin_variation1_64bit.phpt dechex_variation1_64bit.phpt decoct_vari

2009-06-05 Thread Matt Wilmas
mattwil Fri Jun  5 17:15:18 2009 UTC

  Modified files:  
/php-src/ext/standard/tests/array   array_slice_variation2.phpt 
array_slice_variation3.phpt 
/php-src/ext/standard/tests/mathdecbin_variation1_64bit.phpt 
dechex_variation1_64bit.phpt 
decoct_variation1_64bit.phpt 
  Log:
  Fixed tests again after double-long conversion change (to match 5.2)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_slice_variation2.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/standard/tests/array/array_slice_variation2.phpt
diff -u php-src/ext/standard/tests/array/array_slice_variation2.phpt:1.3 
php-src/ext/standard/tests/array/array_slice_variation2.phpt:1.4
--- php-src/ext/standard/tests/array/array_slice_variation2.phpt:1.3Thu Jun 
 4 18:24:09 2009
+++ php-src/ext/standard/tests/array/array_slice_variation2.phptFri Jun 
 5 17:15:18 2009
@@ -1,5 +1,7 @@
 --TEST--
 Test array_slice() function : usage variations - Pass different data types as 
$offset arg
+--SKIPIF--
+?php if (PHP_INT_SIZE  4) die(skip this test is for 32bit platform only); 
?
 --FILE--
 ?php
 /* Prototype  : array array_slice(array $input, int $offset [, int $length [, 
bool $preserve_keys]])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_slice_variation3.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/standard/tests/array/array_slice_variation3.phpt
diff -u php-src/ext/standard/tests/array/array_slice_variation3.phpt:1.3 
php-src/ext/standard/tests/array/array_slice_variation3.phpt:1.4
--- php-src/ext/standard/tests/array/array_slice_variation3.phpt:1.3Thu Jun 
 4 18:24:09 2009
+++ php-src/ext/standard/tests/array/array_slice_variation3.phptFri Jun 
 5 17:15:18 2009
@@ -1,5 +1,7 @@
 --TEST--
 Test array_slice() function : usage variations - Pass different data types as 
$length arg
+--SKIPIF--
+?php if (PHP_INT_SIZE != 8) die(skip this test is for 64bit platform only); 
?
 --FILE--
 ?php
 /* Prototype  : array array_slice(array $input, int $offset [, int $length [, 
bool $preserve_keys]])
@@ -118,7 +120,11 @@
 }
 
 -- Iteration 7 --
-array(0) {
+array(2) {
+  [uthree]=
+  int(3)
+  [0]=
+  int(4)
 }
 
 -- Iteration 8 --
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/decbin_variation1_64bit.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/math/decbin_variation1_64bit.phpt
diff -u php-src/ext/standard/tests/math/decbin_variation1_64bit.phpt:1.2 
php-src/ext/standard/tests/math/decbin_variation1_64bit.phpt:1.3
--- php-src/ext/standard/tests/math/decbin_variation1_64bit.phpt:1.2Thu Jun 
 4 18:24:09 2009
+++ php-src/ext/standard/tests/math/decbin_variation1_64bit.phptFri Jun 
 5 17:15:18 2009
@@ -107,7 +107,7 @@
 unicode(64) 011011010111
 
 -- Iteration 5 --
-unicode(63) 111
+unicode(1) 0
 
 -- Iteration 6 --
 unicode(1) 0
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/dechex_variation1_64bit.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/math/dechex_variation1_64bit.phpt
diff -u php-src/ext/standard/tests/math/dechex_variation1_64bit.phpt:1.2 
php-src/ext/standard/tests/math/dechex_variation1_64bit.phpt:1.3
--- php-src/ext/standard/tests/math/dechex_variation1_64bit.phpt:1.2Thu Jun 
 4 18:24:09 2009
+++ php-src/ext/standard/tests/math/dechex_variation1_64bit.phptFri Jun 
 5 17:15:18 2009
@@ -107,7 +107,7 @@
 unicode(16) f6d7
 
 -- Iteration 5 --
-unicode(16) 7fff
+unicode(1) 0
 
 -- Iteration 6 --
 unicode(1) 0
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/decoct_variation1_64bit.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/math/decoct_variation1_64bit.phpt
diff -u php-src/ext/standard/tests/math/decoct_variation1_64bit.phpt:1.2 
php-src/ext/standard/tests/math/decoct_variation1_64bit.phpt:1.3
--- php-src/ext/standard/tests/math/decoct_variation1_64bit.phpt:1.2Thu Jun 
 4 18:24:09 2009
+++ php-src/ext/standard/tests/math/decoct_variation1_64bit.phptFri Jun 
 5 17:15:18 2009
@@ -108,7 +108,7 @@
 unicode(22) 173327
 
 -- Iteration 5 --
-unicode(21) 7
+unicode(1) 0
 
 -- Iteration 6 --
 unicode(1) 0



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



Re: [PHP-CVS] cvs: php-src / README.PARAMETER_PARSING_API /win32/build config.w32 ZendEngine2 Zend.m4 zend_API.c zend_compile.c zend_execute.c zend_execute_API.c zend_operators.c zend_operators.h ze

2009-06-05 Thread Matt Wilmas

Hi Tony,

Thanks, comments below...

- Original Message -
From: Antony Dovgal
Sent: Friday, June 05, 2009


On 04.06.2009 22:18, Matt Wilmas wrote:

mattwil Thu Jun  4 18:18:47 2009 UTC


New failed tests:

ext/standard/tests/array/array_slice_variation2.phpt
ext/standard/tests/array/array_slice_variation3.phpt
ext/standard/tests/math/decbin_variation1_64bit.phpt
ext/standard/tests/math/dechex_variation1_64bit.phpt
ext/standard/tests/math/decoct_variation1_64bit.phpt


Made a couple mistakes there with my guessing for the 64-bit tests...

array_slice2/3 are 32-/64-bit only, respectively, in 5.2 though they're 
testing different things.  Hmm.  Well, I changed them to match 5.2.



ext/standard/tests/strings/chunk_split_variation2.phpt
ext/standard/tests/strings/chunk_split_variation5.phpt
ext/standard/tests/strings/chunk_split_variation8.phpt


It looks like these should also be failing with 5.2 on 64-bit?  I'll leave 
them as-is for now then...  Some options:


Skip them on 64-bit?  variation2 could have a 64-bit version added. 
variation5/8 look like the same thing (and don't get why they reference Bug 
#42796).  Their logic for the test value (PHP_INT_MAX * 3) is flawed anyway 
with the old (err, formerly new) double-long conversion method, but that 
could be changed to get the same result cross-platform...



--
Wbr,
Antony Dovgal


- Matt 



--
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/array array_slice_variation2.phpt array_slice_variation3.phpt /ext/standard/tests/math decbin_variation1_64bit.phpt dechex_variation1_64bit.phpt de

2009-06-05 Thread Matt Wilmas
mattwil Fri Jun  5 17:15:33 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard/tests/array   array_slice_variation2.phpt 
array_slice_variation3.phpt 
/php-src/ext/standard/tests/mathdecbin_variation1_64bit.phpt 
dechex_variation1_64bit.phpt 
decoct_variation1_64bit.phpt 
  Log:
  MFH: Fixed tests again after double-long conversion change (to match 5.2)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_slice_variation2.phpt?r1=1.1.4.3r2=1.1.4.4diff_format=u
Index: php-src/ext/standard/tests/array/array_slice_variation2.phpt
diff -u php-src/ext/standard/tests/array/array_slice_variation2.phpt:1.1.4.3 
php-src/ext/standard/tests/array/array_slice_variation2.phpt:1.1.4.4
--- php-src/ext/standard/tests/array/array_slice_variation2.phpt:1.1.4.3
Thu Jun  4 18:25:05 2009
+++ php-src/ext/standard/tests/array/array_slice_variation2.phptFri Jun 
 5 17:15:33 2009
@@ -1,5 +1,7 @@
 --TEST--
 Test array_slice() function : usage variations - Pass different data types as 
$offset arg
+--SKIPIF--
+?php if (PHP_INT_SIZE  4) die(skip this test is for 32bit platform only); 
?
 --FILE--
 ?php
 /* Prototype  : array array_slice(array $input, int $offset [, int $length [, 
bool $preserve_keys]])
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/array_slice_variation3.phpt?r1=1.1.4.3r2=1.1.4.4diff_format=u
Index: php-src/ext/standard/tests/array/array_slice_variation3.phpt
diff -u php-src/ext/standard/tests/array/array_slice_variation3.phpt:1.1.4.3 
php-src/ext/standard/tests/array/array_slice_variation3.phpt:1.1.4.4
--- php-src/ext/standard/tests/array/array_slice_variation3.phpt:1.1.4.3
Thu Jun  4 18:25:05 2009
+++ php-src/ext/standard/tests/array/array_slice_variation3.phptFri Jun 
 5 17:15:33 2009
@@ -1,5 +1,7 @@
 --TEST--
 Test array_slice() function : usage variations - Pass different data types as 
$length arg
+--SKIPIF--
+?php if (PHP_INT_SIZE != 8) die(skip this test is for 64bit platform only); 
?
 --FILE--
 ?php
 /* Prototype  : array array_slice(array $input, int $offset [, int $length [, 
bool $preserve_keys]])
@@ -118,7 +120,11 @@
 }
 
 -- Iteration 7 --
-array(0) {
+array(2) {
+  [three]=
+  int(3)
+  [0]=
+  int(4)
 }
 
 -- Iteration 8 --
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/decbin_variation1_64bit.phpt?r1=1.1.2.3r2=1.1.2.4diff_format=u
Index: php-src/ext/standard/tests/math/decbin_variation1_64bit.phpt
diff -u php-src/ext/standard/tests/math/decbin_variation1_64bit.phpt:1.1.2.3 
php-src/ext/standard/tests/math/decbin_variation1_64bit.phpt:1.1.2.4
--- php-src/ext/standard/tests/math/decbin_variation1_64bit.phpt:1.1.2.3
Thu Jun  4 18:25:05 2009
+++ php-src/ext/standard/tests/math/decbin_variation1_64bit.phptFri Jun 
 5 17:15:33 2009
@@ -107,7 +107,7 @@
 string(64) 011011010111
 
 -- Iteration 5 --
-string(63) 111
+string(1) 0
 
 -- Iteration 6 --
 string(1) 0
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/dechex_variation1_64bit.phpt?r1=1.1.2.3r2=1.1.2.4diff_format=u
Index: php-src/ext/standard/tests/math/dechex_variation1_64bit.phpt
diff -u php-src/ext/standard/tests/math/dechex_variation1_64bit.phpt:1.1.2.3 
php-src/ext/standard/tests/math/dechex_variation1_64bit.phpt:1.1.2.4
--- php-src/ext/standard/tests/math/dechex_variation1_64bit.phpt:1.1.2.3
Thu Jun  4 18:25:05 2009
+++ php-src/ext/standard/tests/math/dechex_variation1_64bit.phptFri Jun 
 5 17:15:33 2009
@@ -107,7 +107,7 @@
 string(16) f6d7
 
 -- Iteration 5 --
-string(16) 7fff
+string(1) 0
 
 -- Iteration 6 --
 string(1) 0
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/math/decoct_variation1_64bit.phpt?r1=1.1.2.3r2=1.1.2.4diff_format=u
Index: php-src/ext/standard/tests/math/decoct_variation1_64bit.phpt
diff -u php-src/ext/standard/tests/math/decoct_variation1_64bit.phpt:1.1.2.3 
php-src/ext/standard/tests/math/decoct_variation1_64bit.phpt:1.1.2.4
--- php-src/ext/standard/tests/math/decoct_variation1_64bit.phpt:1.1.2.3
Thu Jun  4 18:25:05 2009
+++ php-src/ext/standard/tests/math/decoct_variation1_64bit.phptFri Jun 
 5 17:15:33 2009
@@ -108,7 +108,7 @@
 string(22) 173327
 
 -- Iteration 5 --
-string(21) 7
+string(1) 0
 
 -- Iteration 6 --
 string(1) 0



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



[PHP-CVS] cvs: php-src /ext/interbase php_ibase_udf.c /ext/mbstring php_mbregex.c /ext/pcre php_pcre.c /ext/standard assert.c /sapi/cli php_cli.c ZendEngine2 zend_builtin_functions.c zend_execute

2009-06-05 Thread Matt Wilmas
mattwil Fri Jun  5 18:50:10 2009 UTC

  Modified files:  
/ZendEngine2zend_builtin_functions.c zend_execute.h 
zend_execute_API.c 
/php-src/ext/interbase  php_ibase_udf.c 
/php-src/ext/mbstring   php_mbregex.c 
/php-src/ext/pcre   php_pcre.c 
/php-src/ext/standard   assert.c 
/php-src/sapi/cli   php_cli.c 
  Log:
  Added zend_eval_stringl and made create_function(), etc. binary-safe
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.405r2=1.406diff_format=u
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.405 
ZendEngine2/zend_builtin_functions.c:1.406
--- ZendEngine2/zend_builtin_functions.c:1.405  Mon May 25 14:32:13 2009
+++ ZendEngine2/zend_builtin_functions.cFri Jun  5 18:50:10 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_builtin_functions.c,v 1.405 2009/05/25 14:32:13 felipe Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.406 2009/06/05 18:50:10 mattwil Exp $ */
 
 #include zend.h
 #include zend_API.h
@@ -1696,7 +1696,7 @@
Creates an anonymous function, and returns its name (funny, eh?) */
 ZEND_FUNCTION(create_function)
 {
-   char *eval_code, *function_name;
+   char *eval_code, function_name[sizeof(0lambda_) + MAX_LENGTH_OF_LONG];
int eval_code_length, function_name_length;
zstr args, code;
int args_len, code_len;
@@ -1740,16 +1740,31 @@
code_len = len;
}
 
-   eval_code_length = sizeof(LAMBDA_DECLARE_ENCODING function  
LAMBDA_TEMP_FUNCNAME)
+   eval_code = (char *) emalloc(sizeof(LAMBDA_DECLARE_ENCODING function  
LAMBDA_TEMP_FUNCNAME)
+args_len
+2  /* for the args parentheses */
+2  /* for the curly braces */
-   +code_len;
+   +code_len);
 
-   eval_code = (char *) emalloc(eval_code_length);
-   sprintf(eval_code, %sfunction  LAMBDA_TEMP_FUNCNAME (%s){%s},
-   (type == IS_UNICODE) ? LAMBDA_DECLARE_ENCODING : ,
-   args.s, code.s);
+   if (type == IS_UNICODE) {
+   eval_code_length = sizeof(LAMBDA_DECLARE_ENCODING function  
LAMBDA_TEMP_FUNCNAME () - 1;
+   memcpy(eval_code, LAMBDA_DECLARE_ENCODING function  
LAMBDA_TEMP_FUNCNAME (, eval_code_length);
+   } else {
+   eval_code_length = sizeof(function  LAMBDA_TEMP_FUNCNAME () 
- 1;
+   memcpy(eval_code, function  LAMBDA_TEMP_FUNCNAME (, 
eval_code_length);
+   }
+
+   memcpy(eval_code + eval_code_length, args.s, args_len);
+   eval_code_length += args_len;
+
+   eval_code[eval_code_length++] = ')';
+   eval_code[eval_code_length++] = '{';
+
+   memcpy(eval_code + eval_code_length, code.s, code_len);
+   eval_code_length += code_len;
+
+   eval_code[eval_code_length++] = '}';
+   eval_code[eval_code_length] = '\0';
 
if (type == IS_UNICODE) {
efree(args.s);
@@ -1757,7 +1772,7 @@
}
 
eval_name = zend_make_compiled_string_description(runtime-created 
function TSRMLS_CC);
-   retval = zend_eval_string(eval_code, NULL, eval_name TSRMLS_CC);
+   retval = zend_eval_stringl(eval_code, eval_code_length, NULL, eval_name 
TSRMLS_CC);
efree(eval_code);
efree(eval_name);
 
@@ -1771,15 +1786,13 @@
new_function = *func;
function_add_ref(new_function TSRMLS_CC);
 
-   function_name = (char *) 
emalloc(sizeof(0lambda_)+MAX_LENGTH_OF_LONG);
+   function_name[0] = '\0';
 
do {
-   sprintf(function_name, %clambda_%d, 0, 
++EG(lambda_count));
-   function_name_length = strlen(function_name+1)+1;
+   function_name_length = 1 + sprintf(function_name + 1, 
lambda_%d, ++EG(lambda_count));
} while (zend_hash_add(EG(function_table), function_name, 
function_name_length+1, new_function, sizeof(zend_function), NULL)==FAILURE);
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, 
sizeof(LAMBDA_TEMP_FUNCNAME));
-   RETVAL_ASCII_STRINGL(function_name, function_name_length, 0);
-   efree(function_name);
+   RETURN_ASCII_STRINGL(function_name, function_name_length, 0);
} else {
RETURN_FALSE;
}
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute.h?r1=1.121r2=1.122diff_format=u
Index: ZendEngine2/zend_execute.h
diff -u ZendEngine2/zend_execute.h:1.121 ZendEngine2/zend_execute.h:1.122
--- ZendEngine2/zend_execute.h:1.121Fri Jun  5 11:21:16 2009
+++ ZendEngine2/zend_execute.h  Fri Jun  5 18:50:10 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_execute.h,v 1.121 2009/06/05 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/interbase php_ibase_udf.c /ext/mbstring php_mbregex.c /ext/pcre php_pcre.c /ext/standard assert.c /sapi/cli php_cli.c ZendEngine2 zend_builtin_functions.c zen

2009-06-05 Thread Matt Wilmas
mattwil Fri Jun  5 18:50:32 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/ZendEngine2zend_builtin_functions.c zend_execute.h 
zend_execute_API.c 
/php-src/ext/interbase  php_ibase_udf.c 
/php-src/ext/mbstring   php_mbregex.c 
/php-src/ext/pcre   php_pcre.c 
/php-src/ext/standard   assert.c 
/php-src/sapi/cli   php_cli.c 
  Log:
  MFH: Added zend_eval_stringl and made create_function(), etc. binary-safe
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.277.2.12.2.25.2.49r2=1.277.2.12.2.25.2.50diff_format=u
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.25.2.49 
ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.25.2.50
--- ZendEngine2/zend_builtin_functions.c:1.277.2.12.2.25.2.49   Fri May 22 
11:19:30 2009
+++ ZendEngine2/zend_builtin_functions.cFri Jun  5 18:50:31 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.25.2.49 2009/05/22 11:19:30 
lbarnaud Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.277.2.12.2.25.2.50 2009/06/05 18:50:31 
mattwil Exp $ */
 
 #include zend.h
 #include zend_API.h
@@ -1673,7 +1673,7 @@
 ZEND_FUNCTION(create_function)
 {
char *eval_code, *function_name, *function_args, *function_code;
-   int function_name_length, function_args_len, function_code_len;
+   int eval_code_length, function_name_length, function_args_len, 
function_code_len;
int retval;
char *eval_name;
 
@@ -1681,10 +1681,29 @@
return;
}
 
-   zend_spprintf(eval_code, 0, function  LAMBDA_TEMP_FUNCNAME 
(%s){%s}, function_args, function_code);
+   eval_code = (char *) emalloc(sizeof(function  LAMBDA_TEMP_FUNCNAME)
+   +function_args_len
+   +2  /* for the args parentheses */
+   +2  /* for the curly braces */
+   +function_code_len);
+
+   eval_code_length = sizeof(function  LAMBDA_TEMP_FUNCNAME () - 1;
+   memcpy(eval_code, function  LAMBDA_TEMP_FUNCNAME (, 
eval_code_length);
+
+   memcpy(eval_code + eval_code_length, function_args, function_args_len);
+   eval_code_length += function_args_len;
+
+   eval_code[eval_code_length++] = ')';
+   eval_code[eval_code_length++] = '{';
+
+   memcpy(eval_code + eval_code_length, function_code, function_code_len);
+   eval_code_length += function_code_len;
+
+   eval_code[eval_code_length++] = '}';
+   eval_code[eval_code_length] = '\0';
 
eval_name = zend_make_compiled_string_description(runtime-created 
function TSRMLS_CC);
-   retval = zend_eval_string(eval_code, NULL, eval_name TSRMLS_CC);
+   retval = zend_eval_stringl(eval_code, eval_code_length, NULL, eval_name 
TSRMLS_CC);
efree(eval_code);
efree(eval_name);
 
@@ -1699,10 +1718,10 @@
function_add_ref(new_function);
 
function_name = (char *) 
emalloc(sizeof(0lambda_)+MAX_LENGTH_OF_LONG);
+   function_name[0] = '\0';
 
do {
-   sprintf(function_name, %clambda_%d, 0, 
++EG(lambda_count));
-   function_name_length = strlen(function_name+1)+1;
+   function_name_length = 1 + sprintf(function_name + 1, 
lambda_%d, ++EG(lambda_count));
} while (zend_hash_add(EG(function_table), function_name, 
function_name_length+1, new_function, sizeof(zend_function), NULL)==FAILURE);
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, 
sizeof(LAMBDA_TEMP_FUNCNAME));
RETURN_STRINGL(function_name, function_name_length, 0);
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute.h?r1=1.84.2.4.2.8.2.13r2=1.84.2.4.2.8.2.14diff_format=u
Index: ZendEngine2/zend_execute.h
diff -u ZendEngine2/zend_execute.h:1.84.2.4.2.8.2.13 
ZendEngine2/zend_execute.h:1.84.2.4.2.8.2.14
--- ZendEngine2/zend_execute.h:1.84.2.4.2.8.2.13Fri Jun  5 11:21:31 2009
+++ ZendEngine2/zend_execute.h  Fri Jun  5 18:50:32 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_execute.h,v 1.84.2.4.2.8.2.13 2009/06/05 11:21:31 lbarnaud Exp $ 
*/
+/* $Id: zend_execute.h,v 1.84.2.4.2.8.2.14 2009/06/05 18:50:32 mattwil Exp $ */
 
 #ifndef ZEND_EXECUTE_H
 #define ZEND_EXECUTE_H
@@ -73,7 +73,9 @@
 ZEND_API int zend_lookup_class(const char *name, int name_length, 
zend_class_entry ***ce TSRMLS_DC);
 ZEND_API int zend_lookup_class_ex(const char *name, int name_length, int 
use_autoload, zend_class_entry ***ce TSRMLS_DC);
 ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name 
TSRMLS_DC);
+ZEND_API int zend_eval_stringl(char *str, int str_len, zval *retval_ptr, char 
*string_name TSRMLS_DC);
 ZEND_API int 

[PHP-CVS] cvs: php-src /ext/dom xpath.c /ext/imap php_imap.c /ext/mcrypt mcrypt.c /ext/odbc birdstep.c /ext/posix posix.c /ext/shmop shmop.c /ext/standard basic_functions.c browscap.c head.c /e

2009-06-05 Thread Matt Wilmas
mattwil Sat Jun  6 02:40:14 2009 UTC

  Modified files:  
/php-src/ext/domxpath.c 
/php-src/ext/imap   php_imap.c 
/php-src/ext/mcrypt mcrypt.c 
/php-src/ext/odbc   birdstep.c 
/php-src/ext/posix  posix.c 
/php-src/ext/shmop  shmop.c 
/php-src/ext/standard   basic_functions.c browscap.c head.c 
/php-src/ext/standard/tests/fileparse_ini_file_variation4.phpt 
/php-src/ext/sysvshmsysvshm.c 
/php-src/ext/sysvshm/tests  002.phpt 
/php-src/ext/xslxsltprocessor.c 
/php-src/ext/xsl/tests  xslt011.phpt 
  Log:
  Fixed error message grammar:
   - cannot instead of can not (meaning also can)
   - than instead of then (Hint: then should hardly be needed;
   you're not telling the order in which to do something)
  
  ... plus removed a couple ending. dots
  http://cvs.php.net/viewvc.cgi/php-src/ext/dom/xpath.c?r1=1.47r2=1.48diff_format=u
Index: php-src/ext/dom/xpath.c
diff -u php-src/ext/dom/xpath.c:1.47 php-src/ext/dom/xpath.c:1.48
--- php-src/ext/dom/xpath.c:1.47Tue Mar 10 23:39:13 2009
+++ php-src/ext/dom/xpath.c Sat Jun  6 02:40:13 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xpath.c,v 1.47 2009/03/10 23:39:13 helly Exp $ */
+/* $Id: xpath.c,v 1.48 2009/06/06 02:40:13 mattwil Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -232,7 +232,7 @@
} else if (retval-type == IS_BOOL) {
valuePush(ctxt, 
xmlXPathNewBoolean(retval-value.lval));
} else if (retval-type == IS_OBJECT) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, A 
PHP Object can not be converted to a XPath-string);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, A 
PHP Object cannot be converted to a XPath-string);
valuePush(ctxt, xmlXPathNewString((xmlChar 
*)));
} else {
convert_to_string_with_converter(retval, 
UG(utf8_conv));
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.290r2=1.291diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.290 php-src/ext/imap/php_imap.c:1.291
--- php-src/ext/imap/php_imap.c:1.290   Wed May 20 08:22:38 2009
+++ php-src/ext/imap/php_imap.c Sat Jun  6 02:40:13 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.290 2009/05/20 08:22:38 kalle Exp $ */
+/* $Id: php_imap.c,v 1.291 2009/06/06 02:40:13 mattwil Exp $ */
 
 #define IMAP41
 
@@ -3726,7 +3726,7 @@
if (!cookie) {
cookie = -;
} else if (strlen(cookie)  (SENDBUFLEN - 2 - 2 - 2)) { 
/* validate cookie length -- + CRLF * 2 */
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
The boudary should be no longer then 4kb);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
The boundary should be no longer than 4kb);
RETVAL_FALSE;
goto done;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/mcrypt/mcrypt.c?r1=1.122r2=1.123diff_format=u
Index: php-src/ext/mcrypt/mcrypt.c
diff -u php-src/ext/mcrypt/mcrypt.c:1.122 php-src/ext/mcrypt/mcrypt.c:1.123
--- php-src/ext/mcrypt/mcrypt.c:1.122   Tue May 19 17:46:56 2009
+++ php-src/ext/mcrypt/mcrypt.c Sat Jun  6 02:40:14 2009
@@ -16,7 +16,7 @@
|  Derick Rethans der...@derickrethans.nl|
+--+
  */
-/* $Id: mcrypt.c,v 1.122 2009/05/19 17:46:56 kalle Exp $ */
+/* $Id: mcrypt.c,v 1.123 2009/06/06 02:40:14 mattwil Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1169,7 +1169,7 @@
 int php_mcrypt_iv(php_mcrypt_iv_source source, int size, char **iv_str, int 
*iv_len TSRMLS_DC)
 {
if (size = 0 || size = INT_MAX) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Can not create an 
IV with a size of less then 1 or greater then %d, INT_MAX);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot create an 
IV with a size of less than 1 or greater than %d, INT_MAX);
return FAILURE;
}

http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/birdstep.c?r1=1.26r2=1.27diff_format=u
Index: php-src/ext/odbc/birdstep.c
diff -u php-src/ext/odbc/birdstep.c:1.26 php-src/ext/odbc/birdstep.c:1.27
--- php-src/ext/odbc/birdstep.c:1.26Tue Mar 10 23:39:27 2009
+++ php-src/ext/odbc/birdstep.c Sat Jun  6 02:40:14 2009
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: birdstep.c,v 1.26 2009/03/10 23:39:27 helly Exp $ */
+/* $Id: 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/dom xpath.c /ext/imap php_imap.c /ext/mcrypt mcrypt.c /ext/odbc birdstep.c /ext/posix posix.c /ext/shmop shmop.c /ext/standard basic_functions.c browscap.c h

2009-06-05 Thread Matt Wilmas
mattwil Sat Jun  6 02:40:49 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/domxpath.c 
/php-src/ext/imap   php_imap.c 
/php-src/ext/mcrypt mcrypt.c 
/php-src/ext/odbc   birdstep.c 
/php-src/ext/posix  posix.c 
/php-src/ext/shmop  shmop.c 
/php-src/ext/standard   basic_functions.c browscap.c head.c 
/php-src/ext/standard/tests/fileparse_ini_file_variation4.phpt 
/php-src/ext/sysvshmsysvshm.c 
/php-src/ext/sysvshm/tests  002.phpt 
/php-src/ext/xslxsltprocessor.c 
/php-src/ext/xsl/tests  xslt011.phpt 
  Log:
  MFH: Fixed error message grammar:
   - cannot instead of can not (meaning also can)
   - than instead of then (Hint: then should hardly be needed;
   you're not telling the order in which to do something)
  
  ... plus removed a couple ending. dots
  http://cvs.php.net/viewvc.cgi/php-src/ext/dom/xpath.c?r1=1.26.2.1.2.1.2.12r2=1.26.2.1.2.1.2.13diff_format=u
Index: php-src/ext/dom/xpath.c
diff -u php-src/ext/dom/xpath.c:1.26.2.1.2.1.2.12 
php-src/ext/dom/xpath.c:1.26.2.1.2.1.2.13
--- php-src/ext/dom/xpath.c:1.26.2.1.2.1.2.12   Wed Dec 31 11:15:36 2008
+++ php-src/ext/dom/xpath.c Sat Jun  6 02:40:48 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: xpath.c,v 1.26.2.1.2.1.2.12 2008/12/31 11:15:36 sebastian Exp $ */
+/* $Id: xpath.c,v 1.26.2.1.2.1.2.13 2009/06/06 02:40:48 mattwil Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -232,7 +232,7 @@
} else if (retval-type == IS_BOOL) {
valuePush(ctxt, 
xmlXPathNewBoolean(retval-value.lval));
} else if (retval-type == IS_OBJECT) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, A 
PHP Object can not be converted to a XPath-string);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, A 
PHP Object cannot be converted to a XPath-string);
valuePush(ctxt, xmlXPathNewString((xmlChar 
*)));
} else {
convert_to_string_ex(retval);
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.208.2.7.2.26.2.48r2=1.208.2.7.2.26.2.49diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.48 
php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.49
--- php-src/ext/imap/php_imap.c:1.208.2.7.2.26.2.48 Tue May  5 01:44:22 2009
+++ php-src/ext/imap/php_imap.c Sat Jun  6 02:40:48 2009
@@ -26,7 +26,7 @@
| PHP 4.0 updates:  Zeev Suraski z...@zend.com   |
+--+
  */
-/* $Id: php_imap.c,v 1.208.2.7.2.26.2.48 2009/05/05 01:44:22 jani Exp $ */
+/* $Id: php_imap.c,v 1.208.2.7.2.26.2.49 2009/06/06 02:40:48 mattwil Exp $ */
 
 #define IMAP41
 
@@ -3717,7 +3717,7 @@
if (!cookie) {
cookie = -;
} else if (strlen(cookie)  (SENDBUFLEN - 2 - 2 - 2)) { 
/* validate cookie length -- + CRLF * 2 */
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
The boudary should be no longer then 4kb);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, 
The boundary should be no longer than 4kb);
RETVAL_FALSE;
goto done;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/mcrypt/mcrypt.c?r1=1.91.2.3.2.11.2.17r2=1.91.2.3.2.11.2.18diff_format=u
Index: php-src/ext/mcrypt/mcrypt.c
diff -u php-src/ext/mcrypt/mcrypt.c:1.91.2.3.2.11.2.17 
php-src/ext/mcrypt/mcrypt.c:1.91.2.3.2.11.2.18
--- php-src/ext/mcrypt/mcrypt.c:1.91.2.3.2.11.2.17  Tue May 19 17:47:06 2009
+++ php-src/ext/mcrypt/mcrypt.c Sat Jun  6 02:40:48 2009
@@ -16,7 +16,7 @@
|  Derick Rethans der...@derickrethans.nl|
+--+
  */
-/* $Id: mcrypt.c,v 1.91.2.3.2.11.2.17 2009/05/19 17:47:06 kalle Exp $ */
+/* $Id: mcrypt.c,v 1.91.2.3.2.11.2.18 2009/06/06 02:40:48 mattwil Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -1373,7 +1373,7 @@
}
 
if (size = 0 || size = INT_MAX) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Can not create an 
IV with a size of less then 1 or greater then %d, INT_MAX);
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Cannot create an 
IV with a size of less than 1 or greater than %d, INT_MAX);
RETURN_FALSE;
}

http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/birdstep.c?r1=1.13.2.2.2.2.2.8r2=1.13.2.2.2.2.2.9diff_format=u
Index: php-src/ext/odbc/birdstep.c
diff -u php-src/ext/odbc/birdstep.c:1.13.2.2.2.2.2.8 
php-src/ext/odbc/birdstep.c:1.13.2.2.2.2.2.9
--- php-src/ext/odbc/birdstep.c:1.13.2.2.2.2.2.8Wed 

[PHP-CVS] cvs: php-src / README.PARAMETER_PARSING_API /win32/build config.w32 ZendEngine2 Zend.m4 zend_API.c zend_compile.c zend_execute.c zend_execute_API.c zend_operators.c zend_operators.h zend_v

2009-06-04 Thread Matt Wilmas
mattwil Thu Jun  4 18:18:47 2009 UTC

  Modified files:  
/php-srcREADME.PARAMETER_PARSING_API 
/ZendEngine2Zend.m4 zend_API.c zend_compile.c zend_execute.c 
zend_execute_API.c zend_operators.c zend_operators.h 
zend_vm_def.h zend_vm_execute.h 
/php-src/win32/buildconfig.w32 
  Log:
  Restored double-long conversion behavior to that of PHP 5.2 (on most 
platforms) and prior:
   * Out-of-range numbers overflow/preserve least significant bits (no 
LONG_MAX/MIN limit)
   * See bug #42868 (presumably-rare platform with different results in 5.2)
   * On 32-bit platforms with 64-bit long type, a zend_long64 cast has been 
added,
  otherwise it's the same as 5.2
   * Use this conversion method everywhere instead of some plain (long) casts
  
  Added 'L' parameter parsing specifier to ensure a LONG_MAX/MIN limit:
   * Essentially what 5.3's new conversion was doing in most cases
   * Functions with limit or length type params could be updated to use 
this,
  and prevent confusing overflow behavior with huge numbers (*also* in 5.2)
- See bug #47854, for example; or even #42868 again
  
  # Test updates coming
  http://cvs.php.net/viewvc.cgi/php-src/README.PARAMETER_PARSING_API?r1=1.26r2=1.27diff_format=u
Index: php-src/README.PARAMETER_PARSING_API
diff -u php-src/README.PARAMETER_PARSING_API:1.26 
php-src/README.PARAMETER_PARSING_API:1.27
--- php-src/README.PARAMETER_PARSING_API:1.26   Mon Nov 24 19:18:34 2008
+++ php-src/README.PARAMETER_PARSING_APIThu Jun  4 18:18:46 2009
@@ -48,6 +48,7 @@
  h  - array (returned as HashTable*)
  H  - array or HASH_OF(object) (returned as HashTable*)
  l  - long (long)
+ L  - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (long)
  o  - object of any type (zval*)
  O  - object of specific type given by class entry (zval*, zend_class_entry)
  r  - resource (zval*)
http://cvs.php.net/viewvc.cgi/ZendEngine2/Zend.m4?r1=1.69r2=1.70diff_format=u
Index: ZendEngine2/Zend.m4
diff -u ZendEngine2/Zend.m4:1.69 ZendEngine2/Zend.m4:1.70
--- ZendEngine2/Zend.m4:1.69Tue May 19 11:40:05 2009
+++ ZendEngine2/Zend.m4 Thu Jun  4 18:18:46 2009
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: Zend.m4,v 1.69 2009/05/19 11:40:05 lbarnaud Exp $
+dnl $Id: Zend.m4,v 1.70 2009/06/04 18:18:46 mattwil Exp $
 dnl
 dnl This file contains Zend specific autoconf functions.
 dnl
@@ -117,6 +117,38 @@
 ZEND_FP_EXCEPT
 
 ZEND_CHECK_FLOAT_PRECISION
+
+dnl test whether double cast to long preserves least significant bits
+AC_MSG_CHECKING(whether double cast to long preserves least significant bits)
+
+AC_TRY_RUN([
+#include limits.h
+
+int main()
+{
+   if (sizeof(long) == 4) {
+   double d = (double) LONG_MIN * LONG_MIN + 2e9;
+
+   if ((long) d == 2e9  (long) -d == -2e9) {
+   exit(0);
+   }
+   } else if (sizeof(long) == 8) {
+   double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract 
ULONG_MAX + 1 */
+
+   if ((long) 18e18 == correct) { /* On 64-bit, only check between 
LONG_MAX and ULONG_MAX */
+   exit(0);
+   }
+   }
+   exit(1);
+}
+], [
+  AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long 
preserves least significant bits])
+  AC_MSG_RESULT(yes)
+], [
+  AC_MSG_RESULT(no)
+], [
+  AC_MSG_RESULT(no)
+])

 ])
 
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.502r2=1.503diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.502 ZendEngine2/zend_API.c:1.503
--- ZendEngine2/zend_API.c:1.502Mon May 25 14:32:13 2009
+++ ZendEngine2/zend_API.c  Thu Jun  4 18:18:46 2009
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: zend_API.c,v 1.502 2009/05/25 14:32:13 felipe Exp $ */
+/* $Id: zend_API.c,v 1.503 2009/06/04 18:18:46 mattwil Exp $ */
 
 #include zend.h
 #include zend_execute.h
@@ -343,6 +343,7 @@
 
switch (c) {
case 'l':
+   case 'L':
{
long *p = va_arg(*va, long *);
switch (Z_TYPE_PP(arg)) {
@@ -354,7 +355,17 @@
if ((type = 
is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), p, d, -1)) == 0) {
return long;
} else if (type == 
IS_DOUBLE) {
-   *p = (long) d;
+   if (c == 'L') {
+   if (d  
LONG_MAX) {
+   
*p = LONG_MAX;
+   

[PHP-CVS] cvs: php-src(PHP_5_3) / README.PARAMETER_PARSING_API /win32/build config.w32 ZendEngine2 Zend.m4 zend_API.c zend_compile.c zend_execute.c zend_execute_API.c zend_operators.c zend_operators

2009-06-04 Thread Matt Wilmas
mattwil Thu Jun  4 18:20:48 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcREADME.PARAMETER_PARSING_API 
/ZendEngine2Zend.m4 zend_API.c zend_compile.c zend_execute.c 
zend_execute_API.c zend_operators.c zend_operators.h 
zend_vm_def.h zend_vm_execute.h 
/php-src/win32/buildconfig.w32 
  Log:
  MFH:
  Restored double-long conversion behavior to that of PHP 5.2 (on most 
platforms) and prior:
   * Out-of-range numbers overflow/preserve least significant bits (no 
LONG_MAX/MIN limit)
   * See bug #42868 (presumably-rare platform with different results in 5.2)
   * On 32-bit platforms with 64-bit long type, a zend_long64 cast has been 
added,
  otherwise it's the same as 5.2
   * Use this conversion method everywhere instead of some plain (long) casts
  
  Added 'L' parameter parsing specifier to ensure a LONG_MAX/MIN limit:
   * Essentially what 5.3's new conversion was doing in most cases
   * Functions with limit or length type params could be updated to use 
this,
  and prevent confusing overflow behavior with huge numbers (*also* in 5.2)
- See bug #47854, for example; or even #42868 again
  
  # Test updates coming
  http://cvs.php.net/viewvc.cgi/php-src/README.PARAMETER_PARSING_API?r1=1.7.6.2.2.6r2=1.7.6.2.2.7diff_format=u
Index: php-src/README.PARAMETER_PARSING_API
diff -u php-src/README.PARAMETER_PARSING_API:1.7.6.2.2.6 
php-src/README.PARAMETER_PARSING_API:1.7.6.2.2.7
--- php-src/README.PARAMETER_PARSING_API:1.7.6.2.2.6Mon Nov 24 18:10:36 2008
+++ php-src/README.PARAMETER_PARSING_APIThu Jun  4 18:20:42 2009
@@ -48,6 +48,7 @@
  h  - array (returned as HashTable*)
  H  - array or HASH_OF(object) (returned as HashTable*)
  l  - long (long)
+ L  - long, limits out-of-range numbers to LONG_MAX/LONG_MIN (long)
  o  - object of any type (zval*)
  O  - object of specific type given by class entry (zval*, zend_class_entry)
  r  - resource (zval*)
http://cvs.php.net/viewvc.cgi/ZendEngine2/Zend.m4?r1=1.58.4.4.2.5r2=1.58.4.4.2.6diff_format=u
Index: ZendEngine2/Zend.m4
diff -u ZendEngine2/Zend.m4:1.58.4.4.2.5 ZendEngine2/Zend.m4:1.58.4.4.2.6
--- ZendEngine2/Zend.m4:1.58.4.4.2.5Tue Dec  2 16:19:09 2008
+++ ZendEngine2/Zend.m4 Thu Jun  4 18:20:42 2009
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: Zend.m4,v 1.58.4.4.2.5 2008/12/02 16:19:09 cseiler Exp $
+dnl $Id: Zend.m4,v 1.58.4.4.2.6 2009/06/04 18:20:42 mattwil Exp $
 dnl
 dnl This file contains Zend specific autoconf functions.
 dnl
@@ -117,6 +117,38 @@
 ZEND_FP_EXCEPT
 
 ZEND_CHECK_FLOAT_PRECISION
+
+dnl test whether double cast to long preserves least significant bits
+AC_MSG_CHECKING(whether double cast to long preserves least significant bits)
+
+AC_TRY_RUN([
+#include limits.h
+
+int main()
+{
+   if (sizeof(long) == 4) {
+   double d = (double) LONG_MIN * LONG_MIN + 2e9;
+
+   if ((long) d == 2e9  (long) -d == -2e9) {
+   exit(0);
+   }
+   } else if (sizeof(long) == 8) {
+   double correct = 18e18 - ((double) LONG_MIN * -2); /* Subtract 
ULONG_MAX + 1 */
+
+   if ((long) 18e18 == correct) { /* On 64-bit, only check between 
LONG_MAX and ULONG_MAX */
+   exit(0);
+   }
+   }
+   exit(1);
+}
+], [
+  AC_DEFINE([ZEND_DVAL_TO_LVAL_CAST_OK], 1, [Define if double cast to long 
preserves least significant bits])
+  AC_MSG_RESULT(yes)
+], [
+  AC_MSG_RESULT(no)
+], [
+  AC_MSG_RESULT(no)
+])

 ])
 
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.c?r1=1.296.2.27.2.34.2.63r2=1.296.2.27.2.34.2.64diff_format=u
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.296.2.27.2.34.2.63 
ZendEngine2/zend_API.c:1.296.2.27.2.34.2.64
--- ZendEngine2/zend_API.c:1.296.2.27.2.34.2.63 Mon Apr  6 11:10:31 2009
+++ ZendEngine2/zend_API.c  Thu Jun  4 18:20:42 2009
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: zend_API.c,v 1.296.2.27.2.34.2.63 2009/04/06 11:10:31 dmitry Exp $ */
+/* $Id: zend_API.c,v 1.296.2.27.2.34.2.64 2009/06/04 18:20:42 mattwil Exp $ */
 
 #include zend.h
 #include zend_execute.h
@@ -313,6 +313,7 @@
 
switch (c) {
case 'l':
+   case 'L':
{
long *p = va_arg(*va, long *);
switch (Z_TYPE_PP(arg)) {
@@ -324,14 +325,33 @@
if ((type = 
is_numeric_string(Z_STRVAL_PP(arg), Z_STRLEN_PP(arg), p, d, -1)) == 0) {
return long;
} else if (type == 
IS_DOUBLE) {
-   *p = (long) d;
+   if (c == 'L') {
+

[PHP-CVS] cvs: php-src /ext/date/tests date_sunrise_variation9.phpt date_sunset_variation9.phpt getdate_variation7.phpt gmdate_variation14.phpt gmstrftime_variation2.phpt idate_variation3.phpt localti

2009-06-04 Thread Matt Wilmas
mattwil Thu Jun  4 18:24:09 2009 UTC

  Removed files:   
/php-src/ext/standard/tests/url parse_url_variation_002.phpt 

  Modified files:  
/ZendEngine2/tests  bug39018.phpt int_overflow_64bit.phpt 
int_underflow_32bit.phpt 
/php-src/ext/date/tests date_sunrise_variation9.phpt 
date_sunset_variation9.phpt 
getdate_variation7.phpt 
gmdate_variation14.phpt 
gmstrftime_variation2.phpt 
idate_variation3.phpt 
localtime_variation3.phpt 
strftime_variation23.phpt 
/php-src/ext/ereg/tests split_variation_004.phpt 
spliti_variation_004.phpt 
/php-src/ext/standard/tests/array   array_fill_variation1.phpt 
array_slice_variation2.phpt 
array_slice_variation3.phpt 
/php-src/ext/standard/tests/general_functions   

gettype_settype_variation2.phpt 
/php-src/ext/standard/tests/mathdecbin_variation1.phpt 
decbin_variation1_64bit.phpt 
dechex_variation1.phpt 
dechex_variation1_64bit.phpt 
decoct_variation1.phpt 
decoct_variation1_64bit.phpt 
/php-src/ext/standard/tests/strings chunk_split_variation2.phpt 
htmlspecialchars_decode_variation2.phpt 
pack.phpt 
sprintf_variation35.phpt 
sprintf_variation4.phpt 
sprintf_variation41.phpt 
vfprintf_variation15.phpt 
vfprintf_variation16.phpt 
vfprintf_variation4.phpt 
vprintf_variation15.phpt 
vprintf_variation15_64bit.phpt 
vprintf_variation16.phpt 
vprintf_variation4.phpt 
vsprintf_variation15.phpt 
vsprintf_variation15_64bit.phpt 
vsprintf_variation16.phpt 
vsprintf_variation4.phpt 
/php-src/ext/standard/tests/url parse_url_variation_002_32bit.phpt 
parse_url_variation_002_64bit.phpt 
  Log:
  Updated tests after double-long conversion change (basically to match 5.2)
  
  # Let me know about other failing tests I missed
  http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39018.phpt?r1=1.3r2=1.4diff_format=u
Index: ZendEngine2/tests/bug39018.phpt
diff -u ZendEngine2/tests/bug39018.phpt:1.3 ZendEngine2/tests/bug39018.phpt:1.4
--- ZendEngine2/tests/bug39018.phpt:1.3 Tue Mar 11 11:06:10 2008
+++ ZendEngine2/tests/bug39018.phpt Thu Jun  4 18:24:08 2009
@@ -65,7 +65,7 @@
 
 Notice: Uninitialized string offset: 0 in %s on line 12
 
-Notice: Uninitialized string offset: -%d in %s on line 16
+Notice: Uninitialized string offset: %i in %s on line 16
 
 Notice: Uninitialized string offset: 4 in %s on line 28
 
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/int_overflow_64bit.phpt?r1=1.4r2=1.5diff_format=u
Index: ZendEngine2/tests/int_overflow_64bit.phpt
diff -u ZendEngine2/tests/int_overflow_64bit.phpt:1.4 
ZendEngine2/tests/int_overflow_64bit.phpt:1.5
--- ZendEngine2/tests/int_overflow_64bit.phpt:1.4   Mon May 26 14:33:43 2008
+++ ZendEngine2/tests/int_overflow_64bit.phpt   Thu Jun  4 18:24:08 2009
@@ -24,9 +24,9 @@
 ?
 --EXPECT--
 int(9223372036854775807)
-int(9223372036854775807)
-int(9223372036854775807)
-int(9223372036854775807)
+int(-9223372036854775808)
+int(-9223372036854775808)
+int(0)
 int(-9223372036854775808)
 int(-9223372036854775808)
 int(-9223372036854775808)
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/int_underflow_32bit.phpt?r1=1.3r2=1.4diff_format=u
Index: ZendEngine2/tests/int_underflow_32bit.phpt
diff -u ZendEngine2/tests/int_underflow_32bit.phpt:1.3 
ZendEngine2/tests/int_underflow_32bit.phpt:1.4
--- ZendEngine2/tests/int_underflow_32bit.phpt:1.3  Mon May 26 14:33:43 2008
+++ ZendEngine2/tests/int_underflow_32bit.phpt  Thu Jun  4 18:24:08 2009
@@ -22,8 +22,8 @@
 ?
 --EXPECT--
 int(-2147483648)
-int(-2147483648)
-int(-2147483648)
-int(-2147483648)
-int(-2147483648)
+int(2147483647)
+int(2147483638)
+int(2147483548)
+int(2147482648)
 Done

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/date/tests date_sunrise_variation9.phpt date_sunset_variation9.phpt getdate_variation7.phpt gmdate_variation14.phpt gmstrftime_variation2.phpt idate_variation3.php

2009-06-04 Thread Matt Wilmas
mattwil Thu Jun  4 18:25:06 2009 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/url parse_url_variation_002_32bit.phpt 
parse_url_variation_002_64bit.phpt 

  Removed files:   
/php-src/ext/standard/tests/url parse_url_variation_002.phpt 

  Modified files:  
/ZendEngine2/tests  bug39018.phpt int_overflow_64bit.phpt 
int_underflow_32bit.phpt 
/php-src/ext/date/tests date_sunrise_variation9.phpt 
date_sunset_variation9.phpt 
getdate_variation7.phpt 
gmdate_variation14.phpt 
gmstrftime_variation2.phpt 
idate_variation3.phpt 
localtime_variation3.phpt 
strftime_variation23.phpt 
/php-src/ext/ereg/tests split_variation_004.phpt 
spliti_variation_004.phpt 
/php-src/ext/standard/tests/array   array_fill_variation1.phpt 
array_slice_variation2.phpt 
array_slice_variation3.phpt 
/php-src/ext/standard/tests/general_functions   

gettype_settype_variation2.phpt 
/php-src/ext/standard/tests/mathdecbin_variation1.phpt 
decbin_variation1_64bit.phpt 
dechex_variation1.phpt 
dechex_variation1_64bit.phpt 
decoct_variation1.phpt 
decoct_variation1_64bit.phpt 
/php-src/ext/standard/tests/strings chunk_split_variation2.phpt 
htmlspecialchars_decode_variation2.phpt 
pack.phpt 
sprintf_variation35.phpt 
sprintf_variation4.phpt 
sprintf_variation41.phpt 
str_split_variation2.phpt 
vfprintf_variation15.phpt 
vfprintf_variation16.phpt 
vfprintf_variation4.phpt 
vprintf_variation15.phpt 
vprintf_variation15_64bit.phpt 
vprintf_variation16.phpt 
vprintf_variation4.phpt 
vsprintf_variation15.phpt 
vsprintf_variation15_64bit.phpt 
vsprintf_variation16.phpt 
vsprintf_variation4.phpt 
  Log:
  MFH: Updated tests after double-long conversion change (basically to match 
5.2)
  
  # Let me know about other failing tests I missed
  http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug39018.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: ZendEngine2/tests/bug39018.phpt
diff -u ZendEngine2/tests/bug39018.phpt:1.1.2.2 
ZendEngine2/tests/bug39018.phpt:1.1.2.3
--- ZendEngine2/tests/bug39018.phpt:1.1.2.2 Tue Mar 11 11:04:53 2008
+++ ZendEngine2/tests/bug39018.phpt Thu Jun  4 18:25:05 2009
@@ -65,7 +65,7 @@
 
 Notice: Uninitialized string offset: 0 in %s on line 12
 
-Notice: Uninitialized string offset: -%d in %s on line 16
+Notice: Uninitialized string offset: %i in %s on line 16
 
 Notice: Uninitialized string offset: 4 in %s on line 28
 
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/int_overflow_64bit.phpt?r1=1.1.2.1.2.1r2=1.1.2.1.2.2diff_format=u
Index: ZendEngine2/tests/int_overflow_64bit.phpt
diff -u ZendEngine2/tests/int_overflow_64bit.phpt:1.1.2.1.2.1 
ZendEngine2/tests/int_overflow_64bit.phpt:1.1.2.1.2.2
--- ZendEngine2/tests/int_overflow_64bit.phpt:1.1.2.1.2.1   Mon Dec 24 
18:09:50 2007
+++ ZendEngine2/tests/int_overflow_64bit.phpt   Thu Jun  4 18:25:05 2009
@@ -22,12 +22,12 @@
 
 echo Done\n;
 ?
---EXPECTF--
-int(9223372036854775807)
-int(9223372036854775807)
-int(9223372036854775807)
+--EXPECT--
 int(9223372036854775807)
 int(-9223372036854775808)
 int(-9223372036854775808)
+int(0)
+int(-9223372036854775808)
+int(-9223372036854775808)
 int(-9223372036854775808)
 Done
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/int_underflow_32bit.phpt?r1=1.1.2.1r2=1.1.2.1.2.1diff_format=u
Index: ZendEngine2/tests/int_underflow_32bit.phpt
diff -u ZendEngine2/tests/int_underflow_32bit.phpt:1.1.2.1 
ZendEngine2/tests/int_underflow_32bit.phpt:1.1.2.1.2.1
--- ZendEngine2/tests/int_underflow_32bit.phpt:1.1.2.1  Thu Sep 28 11:44:05 2006
+++ ZendEngine2/tests/int_underflow_32bit.phpt  Thu Jun  4 18:25:05 

Re: [PHP-CVS] cvs: php-src / README.PARAMETER_PARSING_API /win32/build config.w32 ZendEngine2 Zend.m4 zend_API.c zend_compile.c zend_execute.c zend_execute_API.c zend_operators.c zend_operators.h ze

2009-06-04 Thread Matt Wilmas

Hi Andrei,

- Original Message -
From: Andrei Zmievski
Sent: Thursday, June 04, 2009


Hmm, can we use something other than L? We were hoping to reserve L for 
use in PHP 6 for bigint numbers.


Sure!  It makes no difference to me at all.  Should I just remove that part 
completely?  I didn't know if it would even be used -- just thinking more of 
it's there if someone wants the option...



-Andrei


- Matt


Matt Wilmas wrote:

mattwil Thu Jun  4 18:18:47 2009 UTC

  Modified files:  /php-src README.PARAMETER_PARSING_API 
/ZendEngine2 Zend.m4 zend_API.c zend_compile.c zend_execute.c 
zend_execute_API.c zend_operators.c zend_operators.h zend_vm_def.h 
zend_vm_execute.h /php-src/win32/build config.w32 Log:
  Restored double-long conversion behavior to that of PHP 5.2 (on most 
platforms) and prior:
   * Out-of-range numbers overflow/preserve least significant bits (no 
LONG_MAX/MIN limit)
   * See bug #42868 (presumably-rare platform with different results in 
5.2)
   * On 32-bit platforms with 64-bit long type, a zend_long64 cast has 
been added,

  otherwise it's the same as 5.2
   * Use this conversion method everywhere instead of some plain (long) 
casts


  Added 'L' parameter parsing specifier to ensure a LONG_MAX/MIN limit:
   * Essentially what 5.3's new conversion was doing in most cases
   * Functions with limit or length type params could be updated to 
use this,
  and prevent confusing overflow behavior with huge numbers (*also* 
in 5.2)

- See bug #47854, for example; or even #42868 again

  # Test updates coming 



--
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) / NEWS

2009-05-13 Thread Matt Wilmas
mattwil Thu May 14 01:31:02 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  Now in 5.2 (or should the entry be here as well...?)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.600r2=1.2027.2.547.2.965.2.601diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.600 
php-src/NEWS:1.2027.2.547.2.965.2.601
--- php-src/NEWS:1.2027.2.547.2.965.2.600   Wed May 13 20:25:43 2009
+++ php-src/NEWSThu May 14 01:31:02 2009
@@ -143,7 +143,6 @@
 - Fixed bug #46347 (parse_ini_file() doesn't support * in keys). (Nuno)
 - Fixed bug #46048 (SimpleXML top-level @attributes not part of iterator).
   (David C.)
-- Fixed bug #45877 (Array key '2147483647' left as string). (Matt)
 - Fixed bug #45682 (Unable to var_dump(DateInterval)). (Derick)
 - Fixed bug #45432 (PDO: persistent connection leak). (Felipe)
 - Fixed bug #43831 ($this gets mangled when extending PDO with persistent 



-- 
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) / NEWS

2009-05-04 Thread Matt Wilmas
mattwil Tue May  5 00:55:27 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  Changed wording
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.584r2=1.2027.2.547.2.965.2.585diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.584 
php-src/NEWS:1.2027.2.547.2.965.2.585
--- php-src/NEWS:1.2027.2.547.2.965.2.584   Tue May  5 00:39:33 2009
+++ php-src/NEWSTue May  5 00:55:27 2009
@@ -22,7 +22,7 @@
   open(2) system call. (Mikko)
 - Added dechunk filter which can decode HTTP responses with chunked
   transfer-encoding. HTTP streams use this filter automatically in case
-  Transfer-Encoding: chunked header presents in response. It's possible to
+  Transfer-Encoding: chunked header is present in response. It's possible to
   disable this behaviour using http=array(auto_decode=0) in stream
   context. (Dmitry)
 - Added ability to throw exceptions from SQLite3 instead of warnings. (Scott)



-- 
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 highlight_file.phpt ZendEngine2 zend_highlight.c zend_language_scanner.l

2009-05-04 Thread Matt Wilmas
mattwil Tue May  5 01:35:13 2009 UTC

  Modified files:  
/ZendEngine2zend_highlight.c zend_language_scanner.l 
/php-src/ext/standard/tests/strings highlight_file.phpt 
  Log:
  Implemented manual scanning for strings/comments, plus misc. fixes
  For details, see http://news.php.net/php.internals/43808
  http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_highlight.c?r1=1.65r2=1.66diff_format=u
Index: ZendEngine2/zend_highlight.c
diff -u ZendEngine2/zend_highlight.c:1.65 ZendEngine2/zend_highlight.c:1.66
--- ZendEngine2/zend_highlight.c:1.65   Wed Dec 31 11:12:29 2008
+++ ZendEngine2/zend_highlight.cTue May  5 01:35:13 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_highlight.c,v 1.65 2008/12/31 11:12:29 sebastian Exp $ */
+/* $Id: zend_highlight.c,v 1.66 2009/05/05 01:35:13 mattwil Exp $ */
 
 #include zend.h
 #include zend_language_parser.h
@@ -127,14 +127,8 @@
zend_printf(span style=\color: %s\, 
last_color);
}
}
-   switch (token_type) {
-   case T_END_HEREDOC:
-   zend_html_puts(Z_STRVAL(token), Z_STRLEN(token) 
TSRMLS_CC);
-   break;
-   default:
-   zend_html_puts(LANG_SCNG(yy_text), 
LANG_SCNG(yy_leng) TSRMLS_CC);
-   break;
-   }
+
+   zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng) 
TSRMLS_CC);
 
if (Z_TYPE(token) == IS_STRING ||
Z_TYPE(token) == IS_UNICODE) {
@@ -156,19 +150,6 @@
Z_TYPE(token) = 0;
}
 
-   /* handler for trailing comments, see bug #42767 */
-   if (LANG_SCNG(yy_leng)  LANG_SCNG(yy_text)  LANG_SCNG(yy_limit)) {
-   if (last_color != syntax_highlighter_ini-highlight_comment) {
-   if (last_color != 
syntax_highlighter_ini-highlight_html) {
-   zend_printf(/span);
-   }
-   if (syntax_highlighter_ini-highlight_comment != 
syntax_highlighter_ini-highlight_html) {
-   zend_printf(span style=\color: %s\, 
syntax_highlighter_ini-highlight_comment);
-   }
-   }
-   zend_html_puts(LANG_SCNG(yy_text), (LANG_SCNG(yy_limit) - 
LANG_SCNG(yy_text)) TSRMLS_CC);
-   }
-
if (last_color != syntax_highlighter_ini-highlight_html) {
zend_printf(/span\n);
}
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_language_scanner.l?r1=1.205r2=1.206diff_format=u
Index: ZendEngine2/zend_language_scanner.l
diff -u ZendEngine2/zend_language_scanner.l:1.205 
ZendEngine2/zend_language_scanner.l:1.206
--- ZendEngine2/zend_language_scanner.l:1.205   Thu Mar 26 20:01:38 2009
+++ ZendEngine2/zend_language_scanner.l Tue May  5 01:35:13 2009
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: zend_language_scanner.l,v 1.205 2009/03/26 20:01:38 felipe Exp $ */
+/* $Id: zend_language_scanner.l,v 1.206 2009/05/05 01:35:13 mattwil Exp $ */
 
 #if 0
 # define YYDEBUG(s, c) printf(state: %d char: %c\n, s, c)
@@ -115,13 +115,19 @@
} \
 }
 
+/* To save initial string length after scanning to first variable, 
CG(doc_comment_len) can be reused */
+#define SET_DOUBLE_QUOTES_SCANNED_LENGTH(len) CG(doc_comment_len) = (len)
+#define GET_DOUBLE_QUOTES_SCANNED_LENGTH()CG(doc_comment_len)
+
+#define IS_LABEL_START(c) (((c) = 'a'  (c) = 'z') || ((c) = 'A'  (c) = 
'Z') || (c) == '_' || (c) = 0x7F)
+
 #define ZEND_IS_OCT(c)  ((c)='0'  (c)='7')
 #define ZEND_IS_HEX(c)  (((c)='0'  (c)='9') || ((c)='a'  (c)='f') || 
((c)='A'  (c)='F'))
 
 BEGIN_EXTERN_C()
 
 static void _yy_push_state(int new_state TSRMLS_DC)
- {
+{
zend_stack_push(SCNG(state_stack), (void *) YYGETCONDITION(), 
sizeof(int));
YYSETCONDITION(new_state);
 }
@@ -1324,63 +1330,8 @@
 WHITESPACE [ \n\r\t]+
 TABS_AND_SPACES [ \t]*
 TOKENS [;:,.\[\]()|^+-/*=%!~$?...@]
-ANY_CHAR [^\x00]
+ANY_CHAR [^]
 NEWLINE (\r|\n|\r\n)
-NULL [\x00]{1}
-
-/*
- * LITERAL_DOLLAR matches unescaped $ that aren't followed by a label character
- * or a { and therefore will be taken literally. The case of literal $ before
- * a variable or ${ is handled in a rule for each string type
- */
-DOUBLE_QUOTES_LITERAL_DOLLAR ($+([^a-zA-Z_\x7f-\xff$\\{]|(\\{ANY_CHAR})))
-BACKQUOTE_LITERAL_DOLLAR ($+([^a-zA-Z_\x7f-\xff$`\\{]|(\\{ANY_CHAR})))
-HEREDOC_LITERAL_DOLLAR   ($+([^a-zA-Z_\x7f-\xff$\n\r\\{]|(\\[^\n\r])))
-
-/*
- * Usually, HEREDOC_NEWLINE will just function like a simple NEWLINE, but some
- * special cases need to be handled. HEREDOC_CHARS doesn't allow a line to
- * match when { or $, and/or \ is at the end. (({*|$*)\\?) handles that,
- * along with cases where { or $, and/or 

[PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/standard/tests/strings highlight_file.phpt ZendEngine2 zend_highlight.c zend_language_scanner.l

2009-05-04 Thread Matt Wilmas
mattwil Tue May  5 01:35:44 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
/ZendEngine2zend_highlight.c zend_language_scanner.l 
/php-src/ext/standard/tests/strings highlight_file.phpt 
  Log:
  MFH: Implemented manual scanning for strings/comments, plus misc. fixes
  http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.585r2=1.2027.2.547.2.965.2.586diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.585 
php-src/NEWS:1.2027.2.547.2.965.2.586
--- php-src/NEWS:1.2027.2.547.2.965.2.585   Tue May  5 00:55:27 2009
+++ php-src/NEWSTue May  5 01:35:43 2009
@@ -59,6 +59,8 @@
 - Fixed bug #47038 (Memory leak in include). (Dmitry)
 - Fixed bug #47021 (SoapClient stumbles over WSDL delivered with
   Transfer-Encoding: chunked). (Dmitry)
+- Fixed bug #46817 (tokenizer misses last single-line comment (PHP 5.3+, with
+  re2c lexer)). (Matt, Shire)
 - Fixed bug #46108 (DateTime - Memory leak when unserializing). (Felipe)
 - Fixed bug #44861 (scrollable cursor don't work with pgsql). (Matteo)
 - Fixed bug #44409 (PDO::FETCH_SERIALIZE calls __construct()). (Matteo)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_highlight.c?r1=1.49.2.3.2.2.2.6r2=1.49.2.3.2.2.2.7diff_format=u
Index: ZendEngine2/zend_highlight.c
diff -u ZendEngine2/zend_highlight.c:1.49.2.3.2.2.2.6 
ZendEngine2/zend_highlight.c:1.49.2.3.2.2.2.7
--- ZendEngine2/zend_highlight.c:1.49.2.3.2.2.2.6   Wed Dec 31 11:15:32 2008
+++ ZendEngine2/zend_highlight.cTue May  5 01:35:44 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: zend_highlight.c,v 1.49.2.3.2.2.2.6 2008/12/31 11:15:32 sebastian Exp 
$ */
+/* $Id: zend_highlight.c,v 1.49.2.3.2.2.2.7 2009/05/05 01:35:44 mattwil Exp $ 
*/
 
 #include zend.h
 #include zend_language_parser.h
@@ -142,14 +142,8 @@
zend_printf(span style=\color: %s\, 
last_color);
}
}
-   switch (token_type) {
-   case T_END_HEREDOC:
-   zend_html_puts(token.value.str.val, 
token.value.str.len TSRMLS_CC);
-   break;
-   default:
-   zend_html_puts(LANG_SCNG(yy_text), 
LANG_SCNG(yy_leng) TSRMLS_CC);
-   break;
-   }
+
+   zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng) 
TSRMLS_CC);
 
if (token.type == IS_STRING) {
switch (token_type) {
@@ -170,19 +164,6 @@
token.type = 0;
}
 
-   /* handler for trailing comments, see bug #42767 */
-   if (LANG_SCNG(yy_leng)  LANG_SCNG(yy_text)  LANG_SCNG(yy_limit)) {
-   if (last_color != syntax_highlighter_ini-highlight_comment) {
-   if (last_color != 
syntax_highlighter_ini-highlight_html) {
-   zend_printf(/span);
-   }
-   if (syntax_highlighter_ini-highlight_comment != 
syntax_highlighter_ini-highlight_html) {
-   zend_printf(span style=\color: %s\, 
syntax_highlighter_ini-highlight_comment);
-   }
-   }
-   zend_html_puts(LANG_SCNG(yy_text), (LANG_SCNG(yy_limit) - 
LANG_SCNG(yy_text)) TSRMLS_CC);
-   }
-
if (last_color != syntax_highlighter_ini-highlight_html) {
zend_printf(/span\n);
}
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_language_scanner.l?r1=1.131.2.11.2.13.2.39r2=1.131.2.11.2.13.2.40diff_format=u
Index: ZendEngine2/zend_language_scanner.l
diff -u ZendEngine2/zend_language_scanner.l:1.131.2.11.2.13.2.39 
ZendEngine2/zend_language_scanner.l:1.131.2.11.2.13.2.40
--- ZendEngine2/zend_language_scanner.l:1.131.2.11.2.13.2.39Thu Mar 26 
12:37:17 2009
+++ ZendEngine2/zend_language_scanner.l Tue May  5 01:35:44 2009
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: zend_language_scanner.l,v 1.131.2.11.2.13.2.39 2009/03/26 12:37:17 
dmitry Exp $ */
+/* $Id: zend_language_scanner.l,v 1.131.2.11.2.13.2.40 2009/05/05 01:35:44 
mattwil Exp $ */
 
 #if 0
 # define YYDEBUG(s, c) printf(state: %d char: %c\n, s, c)
@@ -109,6 +109,12 @@
} \
 }
 
+/* To save initial string length after scanning to first variable, 
CG(doc_comment_len) can be reused */
+#define SET_DOUBLE_QUOTES_SCANNED_LENGTH(len) CG(doc_comment_len) = (len)
+#define GET_DOUBLE_QUOTES_SCANNED_LENGTH()CG(doc_comment_len)
+
+#define IS_LABEL_START(c) (((c) = 'a'  (c) = 'z') || ((c) = 'A'  (c) = 
'Z') || (c) == '_' || (c) = 0x7F)
+
 #define ZEND_IS_OCT(c)  ((c)='0'  (c)='7')
 #define ZEND_IS_HEX(c)  (((c)='0'  (c)='9') || ((c)='a'  (c)='f') || 
((c)='A'  (c)='F'))
 
@@ -835,63 +841,8 @@
 WHITESPACE [ \n\r\t]+
 TABS_AND_SPACES [ \t]*
 TOKENS 

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

2009-04-15 Thread Matt Wilmas

Hi Ilia,

- Original Message -
From: Ilia Alshanetsky
Sent: Wednesday, April 15, 2009


iliaa Wed Apr 15 14:24:38 2009 UTC

 Modified files:  (Branch: PHP_5_3)
   /php-src/ext/standard mail.c
 Log:

 Fixed bug #47969 (ezmlm_hash() returns different values depend on OS)

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/mail.c?r1=1.87.2.1.2.7.2.9r2=1.87.2.1.2.7.2.10diff_format=u
[...]
@@ -76,7 +76,7 @@
PHP_FUNCTION(ezmlm_hash)
{
 char *str = NULL;
- unsigned long h = 5381L;
+ unsigned int h = 5381;


You're relying on int being 32-bit?  Couldn't it be 64-bit as well? 
http://en.wikipedia.org/wiki/64-bit#64-bit_data_models


BTW, (unsigned long) cast is still used in the loop, although I guess it's 
not affecting that expression...  And the cast in RETURN_LONG((int) h); 
isn't needed, but that was true before.  Just noticed while checking if I 
was missing something else. :-)



- Matt 



--
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 explode.phpt explode1.phpt explode_variation5.phpt explode_variation6.phpt

2009-04-02 Thread Matt Wilmas
mattwil Thu Apr  2 09:42:12 2009 UTC

  Modified files:  
/php-src/ext/standard/tests/strings explode.phpt explode1.phpt 
explode_variation5.phpt 
explode_variation6.phpt 
  Log:
  Fixed tests, reverted changes from bug #47546
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode.phpt?r1=1.11r2=1.12diff_format=u
Index: php-src/ext/standard/tests/strings/explode.phpt
diff -u php-src/ext/standard/tests/strings/explode.phpt:1.11 
php-src/ext/standard/tests/strings/explode.phpt:1.12
--- php-src/ext/standard/tests/strings/explode.phpt:1.11Sun Mar  8 
06:19:40 2009
+++ php-src/ext/standard/tests/strings/explode.phpt Thu Apr  2 09:42:12 2009
@@ -65,9 +65,7 @@
   [0]=
   unicode(11) otherstring
 }
-array(1) {
-  [0]=
-  unicode(11) otherstring
+array(0) {
 }
 array(7) {
   [0]=
@@ -133,23 +131,19 @@
   [20]=
   unicode(1) -
 }
-array(4) {
+array(3) {
   [0]=
   unicode(10) a lazy dog
   [1]=
   unicode(5) jumps
   [2]=
   unicode(4) over
-  [3]=
-  unicode(0) 
 }
-array(3) {
+array(2) {
   [0]=
   unicode(10) a lazy dog
   [1]=
   unicode(5) jumps
-  [2]=
-  unicode(4) over
 }
 array(1) {
   [0]=
@@ -159,13 +153,11 @@
 }
 array(0) {
 }
-array(3) {
+array(2) {
   [0]=
   unicode(10) a lazy dog
   [1]=
   unicode(11) jumps::over
-  [2]=
-  unicode(0) 
 }
 array(1) {
   [0]=
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode1.phpt?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/standard/tests/strings/explode1.phpt
diff -u php-src/ext/standard/tests/strings/explode1.phpt:1.5 
php-src/ext/standard/tests/strings/explode1.phpt:1.6
--- php-src/ext/standard/tests/strings/explode1.phpt:1.5Sun Mar  8 
06:19:40 2009
+++ php-src/ext/standard/tests/strings/explode1.phptThu Apr  2 09:42:12 2009
@@ -113,11 +113,9 @@
 Warning: explode(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 3 --
-array(2) {
+array(1) {
   [0]=
   unicode(10) 1234NULL23
-  [1]=
-  unicode(43) 0TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -134,7 +132,7 @@
   unicode(43) 0TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 4 --
-array(6) {
+array(5) {
   [0]=
   unicode(14) 1234NULL23abcd
   [1]=
@@ -145,8 +143,6 @@
   unicode(0) 
   [4]=
   unicode(0) 
-  [5]=
-  unicode(38) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -163,7 +159,7 @@
   unicode(42) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 5 --
-array(6) {
+array(5) {
   [0]=
   unicode(14) 1234NULL23abcd
   [1]=
@@ -174,8 +170,6 @@
   unicode(0) 
   [4]=
   unicode(0) 
-  [5]=
-  unicode(38) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -192,7 +186,7 @@
   unicode(42) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 6 --
-array(6) {
+array(5) {
   [0]=
   unicode(0) 
   [1]=
@@ -203,8 +197,6 @@
   unicode(12) .23true-
   [4]=
   unicode(0) 
-  [5]=
-  unicode(12) .24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -234,13 +226,11 @@
 Warning: explode(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 8 --
-array(3) {
+array(2) {
   [0]=
   unicode(28) 1234NULL23abcd0TRUEFALSE
   [1]=
   unicode(12) 1.23true
-  [2]=
-  unicode(13) 1.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -257,11 +247,9 @@
   unicode(27) 1.23true-11.24%PHP%ZEND
 }
 -- Iteration 9 --
-array(2) {
+array(1) {
   [0]=
   unicode(28) 1234NULL23abcd0TRUEFALSE
-  [1]=
-  unicode(23) true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -278,7 +266,7 @@
   unicode(23) true-11.24%PHP%ZEND
 }
 -- Iteration 10 --
-array(7) {
+array(6) {
   [0]=
   unicode(3) 123
   [1]=
@@ -291,8 +279,6 @@
   unicode(0) 
   [5]=
   unicode(9) true-11.2
-  [6]=
-  unicode(9) %PHP%ZEND
 }
 array(1) {
   [0]=
@@ -309,13 +295,11 @@
   unicode(53) NULL23abcd0TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 11 --
-array(3) {
+array(2) {
   [0]=
   unicode(48) 1234NULL23abcd0TRUEFALSE-11.23true-11.24
   [1]=
   unicode(3) PHP
-  [2]=
-  unicode(4) ZEND
 }
 array(1) {
   [0]=
@@ -353,7 +337,7 @@
 }
 
 *** Testing explode() for maximum limit of string with Limit = -1 ***
-array(52) {
+array(51) {
   [0]=
   unicode(1) 1
   [1]=
@@ -456,8 +440,6 @@
   unicode(2) 55
   [50]=
   unicode(1) 1
-  [51]=
-  unicode(1) 1
 }
 
 *** Testing explode() with string variations as input argument ***
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode_variation5.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/strings/explode_variation5.phpt
diff -u php-src/ext/standard/tests/strings/explode_variation5.phpt:1.2 
php-src/ext/standard/tests/strings/explode_variation5.phpt:1.3
--- php-src/ext/standard/tests/strings/explode_variation5.phpt:1.2  Sun Mar 
 8 06:19:40 2009
+++ php-src/ext/standard/tests/strings/explode_variation5.phpt  Thu Apr  2 
09:42:12 2009
@@ -33,15 +33,13 @@
 }
 
 -- negative limit (since PHP 5.1) --
-array(4) {

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

2009-04-02 Thread Matt Wilmas
mattwil Thu Apr  2 09:42:26 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard/tests/strings explode.phpt explode1.phpt 
explode_variation5.phpt 
explode_variation6.phpt 
  Log:
  MFH: Fixed tests, reverted changes from bug #47546
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode.phpt?r1=1.4.4.1.2.3r2=1.4.4.1.2.4diff_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.3 
php-src/ext/standard/tests/strings/explode.phpt:1.4.4.1.2.4
--- php-src/ext/standard/tests/strings/explode.phpt:1.4.4.1.2.3 Sun Mar  8 
06:20:00 2009
+++ php-src/ext/standard/tests/strings/explode.phpt Thu Apr  2 09:42:26 2009
@@ -64,9 +64,7 @@
   [0]=
   string(11) otherstring
 }
-array(1) {
-  [0]=
-  string(11) otherstring
+array(0) {
 }
 array(7) {
   [0]=
@@ -132,23 +130,19 @@
   [20]=
   string(1) -
 }
-array(4) {
+array(3) {
   [0]=
   string(10) a lazy dog
   [1]=
   string(5) jumps
   [2]=
   string(4) over
-  [3]=
-  string(0) 
 }
-array(3) {
+array(2) {
   [0]=
   string(10) a lazy dog
   [1]=
   string(5) jumps
-  [2]=
-  string(4) over
 }
 array(1) {
   [0]=
@@ -158,13 +152,11 @@
 }
 array(0) {
 }
-array(3) {
+array(2) {
   [0]=
   string(10) a lazy dog
   [1]=
   string(11) jumps::over
-  [2]=
-  string(0) 
 }
 array(1) {
   [0]=
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode1.phpt?r1=1.1.2.2.2.3r2=1.1.2.2.2.4diff_format=u
Index: php-src/ext/standard/tests/strings/explode1.phpt
diff -u php-src/ext/standard/tests/strings/explode1.phpt:1.1.2.2.2.3 
php-src/ext/standard/tests/strings/explode1.phpt:1.1.2.2.2.4
--- php-src/ext/standard/tests/strings/explode1.phpt:1.1.2.2.2.3Sun Mar 
 8 06:20:00 2009
+++ php-src/ext/standard/tests/strings/explode1.phptThu Apr  2 09:42:26 2009
@@ -113,11 +113,9 @@
 Warning: explode(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 3 --
-array(2) {
+array(1) {
   [0]=
   string(10) 1234NULL23
-  [1]=
-  string(43) 0TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -134,7 +132,7 @@
   string(43) 0TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 4 --
-array(6) {
+array(5) {
   [0]=
   string(14) 1234NULL23abcd
   [1]=
@@ -145,8 +143,6 @@
   string(0) 
   [4]=
   string(0) 
-  [5]=
-  string(38) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -163,7 +159,7 @@
   string(42) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 5 --
-array(6) {
+array(5) {
   [0]=
   string(14) 1234NULL23abcd
   [1]=
@@ -174,8 +170,6 @@
   string(0) 
   [4]=
   string(0) 
-  [5]=
-  string(38) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -192,7 +186,7 @@
   string(42) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 6 --
-array(6) {
+array(5) {
   [0]=
   string(0) 
   [1]=
@@ -203,8 +197,6 @@
   string(12) .23true-
   [4]=
   string(0) 
-  [5]=
-  string(12) .24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -234,13 +226,11 @@
 Warning: explode(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 8 --
-array(3) {
+array(2) {
   [0]=
   string(28) 1234NULL23abcd0TRUEFALSE
   [1]=
   string(12) 1.23true
-  [2]=
-  string(13) 1.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -257,11 +247,9 @@
   string(27) 1.23true-11.24%PHP%ZEND
 }
 -- Iteration 9 --
-array(2) {
+array(1) {
   [0]=
   string(28) 1234NULL23abcd0TRUEFALSE
-  [1]=
-  string(23) true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -278,7 +266,7 @@
   string(23) true-11.24%PHP%ZEND
 }
 -- Iteration 10 --
-array(7) {
+array(6) {
   [0]=
   string(3) 123
   [1]=
@@ -291,8 +279,6 @@
   string(0) 
   [5]=
   string(9) true-11.2
-  [6]=
-  string(9) %PHP%ZEND
 }
 array(1) {
   [0]=
@@ -309,13 +295,11 @@
   string(53) NULL23abcd0TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 11 --
-array(3) {
+array(2) {
   [0]=
   string(48) 1234NULL23abcd0TRUEFALSE-11.23true-11.24
   [1]=
   string(3) PHP
-  [2]=
-  string(4) ZEND
 }
 array(1) {
   [0]=
@@ -353,7 +337,7 @@
 }
 
 *** Testing explode() for maximum limit of string with Limit = -1 ***
-array(52) {
+array(51) {
   [0]=
   string(1) 1
   [1]=
@@ -456,8 +440,6 @@
   string(2) 55
   [50]=
   string(1) 1
-  [51]=
-  string(1) 1
 }
 
 *** Testing explode() with string variations as input argument ***
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode_variation5.phpt?r1=1.1.4.3r2=1.1.4.4diff_format=u
Index: php-src/ext/standard/tests/strings/explode_variation5.phpt
diff -u php-src/ext/standard/tests/strings/explode_variation5.phpt:1.1.4.3 
php-src/ext/standard/tests/strings/explode_variation5.phpt:1.1.4.4
--- php-src/ext/standard/tests/strings/explode_variation5.phpt:1.1.4.3  Sun Mar 
 8 06:20:00 2009
+++ php-src/ext/standard/tests/strings/explode_variation5.phpt  Thu Apr  2 
09:42:26 2009
@@ -33,15 +33,13 @@
 }
 
 

[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/strings explode.phpt explode1.phpt explode_variation5.phpt explode_variation6.phpt

2009-04-02 Thread Matt Wilmas
mattwil Thu Apr  2 09:42:32 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/strings explode.phpt explode1.phpt 
explode_variation5.phpt 
explode_variation6.phpt 
  Log:
  MFH: Fixed tests, reverted changes from bug #47546
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode.phpt?r1=1.4.4.4r2=1.4.4.5diff_format=u
Index: php-src/ext/standard/tests/strings/explode.phpt
diff -u php-src/ext/standard/tests/strings/explode.phpt:1.4.4.4 
php-src/ext/standard/tests/strings/explode.phpt:1.4.4.5
--- php-src/ext/standard/tests/strings/explode.phpt:1.4.4.4 Sun Mar  8 
06:20:12 2009
+++ php-src/ext/standard/tests/strings/explode.phpt Thu Apr  2 09:42:32 2009
@@ -64,9 +64,7 @@
   [0]=
   string(11) otherstring
 }
-array(1) {
-  [0]=
-  string(11) otherstring
+array(0) {
 }
 array(7) {
   [0]=
@@ -132,23 +130,19 @@
   [20]=
   string(1) -
 }
-array(4) {
+array(3) {
   [0]=
   string(10) a lazy dog
   [1]=
   string(5) jumps
   [2]=
   string(4) over
-  [3]=
-  string(0) 
 }
-array(3) {
+array(2) {
   [0]=
   string(10) a lazy dog
   [1]=
   string(5) jumps
-  [2]=
-  string(4) over
 }
 array(1) {
   [0]=
@@ -158,13 +152,11 @@
 }
 array(0) {
 }
-array(3) {
+array(2) {
   [0]=
   string(10) a lazy dog
   [1]=
   string(11) jumps::over
-  [2]=
-  string(0) 
 }
 array(1) {
   [0]=
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode1.phpt?r1=1.1.2.4r2=1.1.2.5diff_format=u
Index: php-src/ext/standard/tests/strings/explode1.phpt
diff -u php-src/ext/standard/tests/strings/explode1.phpt:1.1.2.4 
php-src/ext/standard/tests/strings/explode1.phpt:1.1.2.5
--- php-src/ext/standard/tests/strings/explode1.phpt:1.1.2.4Sun Mar  8 
06:20:12 2009
+++ php-src/ext/standard/tests/strings/explode1.phptThu Apr  2 09:42:32 2009
@@ -113,11 +113,9 @@
 Warning: explode(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 3 --
-array(2) {
+array(1) {
   [0]=
   string(10) 1234NULL23
-  [1]=
-  string(43) 0TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -134,7 +132,7 @@
   string(43) 0TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 4 --
-array(6) {
+array(5) {
   [0]=
   string(14) 1234NULL23abcd
   [1]=
@@ -145,8 +143,6 @@
   string(0) 
   [4]=
   string(0) 
-  [5]=
-  string(38) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -163,7 +159,7 @@
   string(42) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 5 --
-array(6) {
+array(5) {
   [0]=
   string(14) 1234NULL23abcd
   [1]=
@@ -174,8 +170,6 @@
   string(0) 
   [4]=
   string(0) 
-  [5]=
-  string(38) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -192,7 +186,7 @@
   string(42) TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 6 --
-array(6) {
+array(5) {
   [0]=
   string(0) 
   [1]=
@@ -203,8 +197,6 @@
   string(12) .23true-
   [4]=
   string(0) 
-  [5]=
-  string(12) .24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -234,13 +226,11 @@
 Warning: explode(): Empty delimiter in %s on line %d
 bool(false)
 -- Iteration 8 --
-array(3) {
+array(2) {
   [0]=
   string(28) 1234NULL23abcd0TRUEFALSE
   [1]=
   string(12) 1.23true
-  [2]=
-  string(13) 1.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -257,11 +247,9 @@
   string(27) 1.23true-11.24%PHP%ZEND
 }
 -- Iteration 9 --
-array(2) {
+array(1) {
   [0]=
   string(28) 1234NULL23abcd0TRUEFALSE
-  [1]=
-  string(23) true-11.24%PHP%ZEND
 }
 array(1) {
   [0]=
@@ -278,7 +266,7 @@
   string(23) true-11.24%PHP%ZEND
 }
 -- Iteration 10 --
-array(7) {
+array(6) {
   [0]=
   string(3) 123
   [1]=
@@ -291,8 +279,6 @@
   string(0) 
   [5]=
   string(9) true-11.2
-  [6]=
-  string(9) %PHP%ZEND
 }
 array(1) {
   [0]=
@@ -309,13 +295,11 @@
   string(53) NULL23abcd0TRUEFALSE-11.23true-11.24%PHP%ZEND
 }
 -- Iteration 11 --
-array(3) {
+array(2) {
   [0]=
   string(48) 1234NULL23abcd0TRUEFALSE-11.23true-11.24
   [1]=
   string(3) PHP
-  [2]=
-  string(4) ZEND
 }
 array(1) {
   [0]=
@@ -353,7 +337,7 @@
 }
 
 *** Testing explode() for maximum limit of string with Limit = -1 ***
-array(52) {
+array(51) {
   [0]=
   string(1) 1
   [1]=
@@ -456,8 +440,6 @@
   string(2) 55
   [50]=
   string(1) 1
-  [51]=
-  string(1) 1
 }
 
 *** Testing explode() with string variations as input argument ***
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/explode_variation5.phpt?r1=1.1.2.3r2=1.1.2.4diff_format=u
Index: php-src/ext/standard/tests/strings/explode_variation5.phpt
diff -u php-src/ext/standard/tests/strings/explode_variation5.phpt:1.1.2.3 
php-src/ext/standard/tests/strings/explode_variation5.phpt:1.1.2.4
--- php-src/ext/standard/tests/strings/explode_variation5.phpt:1.1.2.3  Sun Mar 
 8 06:20:12 2009
+++ php-src/ext/standard/tests/strings/explode_variation5.phpt  Thu Apr  2 
09:42:32 2009
@@ -33,15 +33,13 @@
 }
 
 -- negative limit (since PHP 5.1) --

Re: [PHP-CVS] cvs: php-src(PHP_5_3) / NEWS /ext/standard php_string.h string.c /ext/standard/tests/strings bug47546.phpt

2009-04-02 Thread Matt Wilmas

Hi Dmitry, Antony,

- Original Message -
From: Dmitry Stogov
Sent: Thursday, April 02, 2009


Hi Matt,

I suppose the following tests start fail after this patch

explode() function [ext/standard/tests/strings/explode.phpt]
Test explode() function [ext/standard/tests/strings/explode1.phpt]
Test explode() function : usage variations - positive and negative limits 
[ext/standard/tests/strings/explode_variation5.phpt]
Test explode() function : usage variations - misc tests 
[ext/standard/tests/strings/explode_variation6.phpt]


Could you please check them.


Fixed, thanks.


Thanks. Dmitry.


- Matt


Matt Wilmas wrote:

mattwil Wed Apr  1 17:05:37 2009 UTC

  Removed files:   (Branch: PHP_5_3)
/php-src/ext/standard/tests/strings bug47546.phpt
  Modified files:  /php-src NEWS /php-src/ext/standard 
php_string.h string.c Log:

  MFH: explode() stuff:
  - Fixed bug #47560 (explode()'s limit parameter odd behaviour) by 
reverting change for bug #47546 



--
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) / NEWS /ext/standard php_string.h string.c /ext/standard/tests/strings bug47546.phpt

2009-04-01 Thread Matt Wilmas
mattwil Wed Apr  1 17:05:37 2009 UTC

  Removed files:   (Branch: PHP_5_3)
/php-src/ext/standard/tests/strings bug47546.phpt 

  Modified files:  
/php-srcNEWS 
/php-src/ext/standard   php_string.h string.c 
  Log:
  MFH: explode() stuff:
  - Fixed bug #47560 (explode()'s limit parameter odd behaviour) by reverting 
change for bug #47546
  - Changed int to long where needed (should fix memory errors from overflow 
seen in bug #47854)
  - Simplified logic a bit with limit and its default value
  - php_explode_negative_limit(): removed safe_emalloc (not needed; plain 
erealloc is used later)
   - Moved declarations/allocation to optimize if the delimiter isn't found
   - Changed ALLOC_STEP size for less realloc's (and maybe better memory block 
alignment?)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.548r2=1.2027.2.547.2.965.2.549diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.548 
php-src/NEWS:1.2027.2.547.2.965.2.549
--- php-src/NEWS:1.2027.2.547.2.965.2.548   Wed Apr  1 14:00:35 2009
+++ php-src/NEWSWed Apr  1 17:05:34 2009
@@ -18,6 +18,7 @@
   crashes). (Dmitry)
 - Fixed bug #47699 (autoload and late static binding). (Dmitry)
 - Fixed bug #47596 (Bus error on parsing file). (Dmitry)
+- Fixed bug #47560 (explode()'s limit parameter odd behaviour). (Matt)
 - Fixed bug #47516 (nowdoc can not be embed in heredoc but can be embed in
   double quote). (Dmitry)
 - Fixed bug #47038 (Memory leak in include). (Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_string.h?r1=1.87.2.2.2.3.2.4r2=1.87.2.2.2.3.2.5diff_format=u
Index: php-src/ext/standard/php_string.h
diff -u php-src/ext/standard/php_string.h:1.87.2.2.2.3.2.4 
php-src/ext/standard/php_string.h:1.87.2.2.2.3.2.5
--- php-src/ext/standard/php_string.h:1.87.2.2.2.3.2.4  Wed Dec 31 11:15:45 2008
+++ php-src/ext/standard/php_string.h   Wed Apr  1 17:05:35 2009
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: php_string.h,v 1.87.2.2.2.3.2.4 2008/12/31 11:15:45 sebastian Exp $ */
+/* $Id: php_string.h,v 1.87.2.2.2.3.2.5 2009/04/01 17:05:35 mattwil Exp $ */
 
 /* Synced with php 3.0 revision 1.43 1999-06-16 [ssb] */
 
@@ -138,7 +138,7 @@
 PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int 
to_len, zval *result, int case_sensitivity, int *replace_count);
 PHPAPI int php_char_to_str(char *str, uint len, char from, char *to, int 
to_len, zval *result);
 PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC);
-PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, int limit);
+PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, long 
limit);
 
 PHPAPI size_t php_strspn(char *s1, char *s2, char *s1_end, char *s2_end); 
 PHPAPI size_t php_strcspn(char *s1, char *s2, char *s1_end, char *s2_end); 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.69.2.45r2=1.445.2.14.2.69.2.46diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.69.2.45 
php-src/ext/standard/string.c:1.445.2.14.2.69.2.46
--- php-src/ext/standard/string.c:1.445.2.14.2.69.2.45  Wed Apr  1 14:00:38 2009
+++ php-src/ext/standard/string.c   Wed Apr  1 17:05:35 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.69.2.45 2009/04/01 14:00:38 iliaa Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.69.2.46 2009/04/01 17:05:35 mattwil Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -928,7 +928,7 @@
 
 /* {{{ php_explode
  */
-PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, int limit) 
+PHPAPI void php_explode(zval *delim, zval *str, zval *return_value, long 
limit) 
 {
char *p1, *p2, *endp;
 
@@ -944,7 +944,7 @@
add_next_index_stringl(return_value, p1, p2 - p1, 1);
p1 = p2 + Z_STRLEN_P(delim);
} while ((p2 = php_memnstr(p1, Z_STRVAL_P(delim), 
Z_STRLEN_P(delim), endp)) != NULL 
-(limit == -1 || --limit  1));
+--limit  1);
 
if (p1 = endp)
add_next_index_stringl(return_value, p1, endp-p1, 1);
@@ -954,12 +954,10 @@
 
 /* {{{ php_explode_negative_limit
  */
-PHPAPI void php_explode_negative_limit(zval *delim, zval *str, zval 
*return_value, int limit) 
+PHPAPI void php_explode_negative_limit(zval *delim, zval *str, zval 
*return_value, long limit) 
 {
-#define EXPLODE_ALLOC_STEP 50
+#define EXPLODE_ALLOC_STEP 64
char *p1, *p2, *endp;
-   int allocated = EXPLODE_ALLOC_STEP, found = 0, i = 0, to_return = 0;
-   char **positions = safe_emalloc(allocated, sizeof(char *), 0);

endp = Z_STRVAL_P(str) + Z_STRLEN_P(str);
 
@@ -972,6 +970,10 @@

[PHP-CVS] cvs: php-src /ext/filter logical_filters.c

2009-03-31 Thread Matt Wilmas
mattwil Tue Mar 31 11:20:31 2009 UTC

  Modified files:  
/php-src/ext/filter logical_filters.c 
  Log:
  - Removed unused LONG_SIGN_MASK definition, and a stray \
  - Changed sign flag to int (it's no longer being used in a calculation)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.37r2=1.38diff_format=u
Index: php-src/ext/filter/logical_filters.c
diff -u php-src/ext/filter/logical_filters.c:1.37 
php-src/ext/filter/logical_filters.c:1.38
--- php-src/ext/filter/logical_filters.c:1.37   Tue Mar 31 10:02:51 2009
+++ php-src/ext/filter/logical_filters.cTue Mar 31 11:20:31 2009
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: logical_filters.c,v 1.37 2009/03/31 10:02:51 dmitry Exp $ */
+/* $Id: logical_filters.c,v 1.38 2009/03/31 11:20:31 mattwil Exp $ */
 
 #include php_filter.h
 #include filter_private.h
@@ -34,8 +34,6 @@
 # include arpa/inet.h
 #endif
 
-#define LONG_SIGN_MASK (1L  (8*sizeof(long)-1))
-
 #ifndef INADDR_NONE
 # define INADDR_NONE ((unsigned long int) -1)
 #endif
@@ -74,7 +72,7 @@
 
 static int php_filter_parse_int(const char *str, unsigned int str_len, long 
*ret TSRMLS_DC) { /* {{{ */
long ctx_value;
-   long sign = 0;
+   int sign = 0;
const char *end = str + str_len;
 
switch (*str) {
@@ -101,7 +99,7 @@
 
while (str  end) {
if (*str = '0'  *str = '9') {
-   ctx_value = (ctx_value * 10) + (*(str++) - '0');
\
+   ctx_value = (ctx_value * 10) + (*(str++) - '0');
} else {
return -1;
}



-- 
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_3) /ext/odbc php_odbc.c

2009-03-23 Thread Matt Wilmas

Hi Ilia,

- Original Message -
From: Ilia Alshanetsky
Sent: Monday, March 23, 2009


iliaa Mon Mar 23 22:30:56 2009 UTC

 Modified files:  (Branch: PHP_5_3)
   /php-src/ext/odbc php_odbc.c
 Log:

 Improved parameter handling

http://cvs.php.net/viewvc.cgi/php-src/ext/odbc/php_odbc.c?r1=1.189.2.4.2.7.2.14r2=1.189.2.4.2.7.2.15diff_format=u
Index: php-src/ext/odbc/php_odbc.c
diff -u php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.14 
php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.15
--- php-src/ext/odbc/php_odbc.c:1.189.2.4.2.7.2.14 Tue Feb 17 12:38:21 
2009

+++ php-src/ext/odbc/php_odbc.c Mon Mar 23 22:30:56 2009
@@ -20,7 +20,7 @@

+--+
*/

-/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.14 2009/02/17 12:38:21 felipe Exp $ 
*/
+/* $Id: php_odbc.c,v 1.189.2.4.2.7.2.15 2009/03/23 22:30:56 iliaa Exp $ 
*/


#ifdef HAVE_CONFIG_H
#include config.h
@@ -1629,17 +1629,15 @@
#ifdef HAVE_SQL_EXTENDED_FETCH
 SQLULEN crow;
 SQLUSMALLINT RowStatus[1];
- SQLLEN rownum = -1;
+ SQLLEN rownum;
 zval *pv_res, *tmp;
- long pv_row;
+ long pv_row - 1;


That last line doesn't look right. :-)

- Matt 



--
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/json JSON_parser.c

2009-03-19 Thread Matt Wilmas
mattwil Thu Mar 19 19:26:00 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/json   JSON_parser.c 
  Log:
  MFH: Avoid 2 conversions when decoding numbers
  
http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.1.2.12.2.8r2=1.1.2.12.2.9diff_format=u
Index: php-src/ext/json/JSON_parser.c
diff -u php-src/ext/json/JSON_parser.c:1.1.2.12.2.8 
php-src/ext/json/JSON_parser.c:1.1.2.12.2.9
--- php-src/ext/json/JSON_parser.c:1.1.2.12.2.8 Tue Mar 17 14:57:39 2009
+++ php-src/ext/json/JSON_parser.c  Thu Mar 19 19:26:00 2009
@@ -289,16 +289,27 @@
 
 if (type == IS_LONG)
 {
-   long l = strtol(buf-c, NULL, 10);
-   double d = zend_strtod(buf-c, NULL);
-   if (d  LONG_MAX || d  LONG_MIN) {
-   ZVAL_DOUBLE(*z, d);
-   } else {
-   ZVAL_LONG(*z, l);
+   if (buf-c[0] == '-') {
+   buf-len--;
}
+
+   if (buf-len = MAX_LENGTH_OF_LONG - 1) {
+   if (buf-len == MAX_LENGTH_OF_LONG - 1) {
+   int cmp = strcmp(buf-c + (buf-c[0] == '-'), 
long_min_digits);
+
+   if (!(cmp  0 || (cmp == 0  buf-c[0] == 
'-'))) {
+   goto use_double;
+   }
+   } else {
+   goto use_double;
+   }
+   }
+
+   ZVAL_LONG(*z, strtol(buf-c, NULL, 10));
 }
 else if (type == IS_DOUBLE)
 {
+use_double:
 ZVAL_DOUBLE(*z, zend_strtod(buf-c, NULL));
 }
 else if (type == IS_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/json JSON_parser.c

2009-03-19 Thread Matt Wilmas
mattwil Thu Mar 19 19:27:14 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/json   JSON_parser.c 
  Log:
  MFH: Handle overflow when decoding large numbers and avoid 2 conversions
  
http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.1.2.16r2=1.1.2.17diff_format=u
Index: php-src/ext/json/JSON_parser.c
diff -u php-src/ext/json/JSON_parser.c:1.1.2.16 
php-src/ext/json/JSON_parser.c:1.1.2.17
--- php-src/ext/json/JSON_parser.c:1.1.2.16 Tue Mar 17 02:02:45 2009
+++ php-src/ext/json/JSON_parser.c  Thu Mar 19 19:27:14 2009
@@ -284,15 +284,27 @@
 
 if (type == IS_LONG)
 {
-   long l = strtol(buf-c, NULL, 10);
-   if (l  LONG_MAX || l  LONG_MIN) {
-   ZVAL_DOUBLE(*z, zend_strtod(buf-c, NULL));
-   } else {
-   ZVAL_LONG(*z, l);
+   if (buf-c[0] == '-') {
+   buf-len--;
}
+
+   if (buf-len = MAX_LENGTH_OF_LONG - 1) {
+   if (buf-len == MAX_LENGTH_OF_LONG - 1) {
+   int cmp = strcmp(buf-c + (buf-c[0] == '-'), 
long_min_digits);
+
+   if (!(cmp  0 || (cmp == 0  buf-c[0] == 
'-'))) {
+   goto use_double;
+   }
+   } else {
+   goto use_double;
+   }
+   }
+
+   ZVAL_LONG(*z, strtol(buf-c, NULL, 10));
 }
 else if (type == IS_DOUBLE)
 {
+use_double:
 ZVAL_DOUBLE(*z, zend_strtod(buf-c, NULL));
 }
 else if (type == IS_STRING)



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



Re: [PHP-CVS] cvs: php-src /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug46882.phpt

2009-03-18 Thread Matt Wilmas

Hi Pierre, Felipe,

- Original Message -
From: Pierre Joye
Sent: Tuesday, March 17, 2009


2009/3/17 Matt Wilmas matt...@php.net:
 mattwil Tue Mar 17 22:02:05 2009 UTC

 Added files:
 /php-src/ext/standard/tests/serialize bug46882.phpt

 Modified files:
 /php-src/ext/standard var_unserializer.c var_unserializer.re
 Log:
 Fixed bug #46882 (Serialize / Unserialize misbehaviour under OS with 
 different bit numbers)


 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.97r2=1.98diff_format=u
 Index: php-src/ext/standard/var_unserializer.c
 diff -u php-src/ext/standard/var_unserializer.c:1.97 
 php-src/ext/standard/var_unserializer.c:1.98


 +--+
 - | PHP Version 6 |
 + | PHP Version 5 |


That's 6 not 5 :)


Hmm, I think I realize how I got that screwed up, with copy/paste and not 
paying attention. :-)  I thought everything was updated, and always check a 
diff first, but missed that...


I see Felipe was on it right away though. :-)  Thanks Felipe!


--
Pierre


- Matt 



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



Re: [PHP-CVS] cvs: php-src /ext/json JSON_parser.c

2009-03-17 Thread Matt Wilmas

Hi Scott,

Didn't get to send a message before you corrected the decoding, but was 
going to suggest the method for long vs double checking that's used in the 
scanner, is_numeric_string(), etc. (and I'm about to add a couple more).  It 
saves from using both strto* functions. :-)  See the attached patch against 
HEAD.


I guess I could go ahead and do it later anyway, since your change didn't 
get merged to 5.2?



- Matt


- Original Message -
From: Scott MacVicar
Sent: Tuesday, March 17, 2009


scottmac Tue Mar 17 14:56:49 2009 UTC

 Modified files:
   /php-src/ext/json JSON_parser.c
 Log:
 Deal with overflow when decoding large numbers



http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.23r2=1.24diff_format=u
Index: php-src/ext/json/JSON_parser.c
diff -u php-src/ext/json/JSON_parser.c:1.23 
php-src/ext/json/JSON_parser.c:1.24

--- php-src/ext/json/JSON_parser.c:1.23 Tue Mar 17 02:00:08 2009
+++ php-src/ext/json/JSON_parser.c Tue Mar 17 14:56:49 2009
@@ -290,8 +290,9 @@
if (type == IS_LONG)
{
 long l = strtol(buf-c, NULL, 10);
- if (l  LONG_MAX || l  LONG_MIN) {
- ZVAL_DOUBLE(*z, zend_strtod(buf-c, NULL));
+ double d = zend_strtod(buf-c, NULL);
+ if (d  LONG_MAX || d  LONG_MIN) {
+ ZVAL_DOUBLE(*z, d);
 } else {
 ZVAL_LONG(*z, l);
 }


Index: ext/json/JSON_parser.c
===
RCS file: /repository/php-src/ext/json/JSON_parser.c,v
retrieving revision 1.24
diff -u -r1.24 JSON_parser.c
--- ext/json/JSON_parser.c  17 Mar 2009 14:56:49 -  1.24
+++ ext/json/JSON_parser.c  17 Mar 2009 19:52:00 -
@@ -289,16 +289,27 @@

if (type == IS_LONG)
{
-   long l = strtol(buf-c, NULL, 10);
-   double d = zend_strtod(buf-c, NULL);
-   if (d  LONG_MAX || d  LONG_MIN) {
-   ZVAL_DOUBLE(*z, d);
-   } else {
-   ZVAL_LONG(*z, l);
+   if (buf-c[0] == '-') {
+   buf-len--;
}
+
+   if (buf-len = MAX_LENGTH_OF_LONG - 1) {
+   if (buf-len == MAX_LENGTH_OF_LONG - 1) {
+   int cmp = strcmp(buf-c + (buf-c[0] == '-'), 
long_min_digits);
+
+   if (!(cmp  0 || (cmp == 0  buf-c[0] == 
'-'))) {
+   goto use_double;
+   }
+   } else {
+   goto use_double;
+   }
+   }
+
+   ZVAL_LONG(*z, strtol(buf-c, NULL, 10));
}
else if (type == IS_DOUBLE)
{
+use_double:
ZVAL_DOUBLE(*z, zend_strtod(buf-c, NULL));
}
else if (type == IS_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 var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug46882.phpt

2009-03-17 Thread Matt Wilmas
mattwil Tue Mar 17 22:02:05 2009 UTC

  Added files: 
/php-src/ext/standard/tests/serialize   bug46882.phpt 

  Modified files:  
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  Fixed bug #46882 (Serialize / Unserialize misbehaviour under OS with 
different bit numbers)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.97r2=1.98diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.97 
php-src/ext/standard/var_unserializer.c:1.98
--- php-src/ext/standard/var_unserializer.c:1.97Tue Mar 10 23:39:41 2009
+++ php-src/ext/standard/var_unserializer.c Tue Mar 17 22:02:05 2009
@@ -1,8 +1,8 @@
-/* Generated by re2c 0.13.5 on Fri Aug 29 18:45:19 2008 */
+/* Generated by re2c 0.13.5 on Tue Mar 17 16:18:00 2009 */
 #line 1 ext/standard/var_unserializer.re
 /*
   +--+
-  | PHP Version 6|
+  | PHP Version 5|
   +--+
   | Copyright (c) 1997-2006 The PHP Group|
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.97 2009/03/10 23:39:41 helly Exp $ */
+/* $Id: var_unserializer.c,v 1.98 2009/03/17 22:02:05 mattwil Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -522,7 +522,7 @@
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy103;
 yy3:
-#line 794 ext/standard/var_unserializer.re
+#line 817 ext/standard/var_unserializer.re
{ return 0; }
 #line 528 ext/standard/var_unserializer.c
 yy4:
@@ -571,7 +571,7 @@
goto yy3;
 yy15:
++YYCURSOR;
-#line 788 ext/standard/var_unserializer.re
+#line 811 ext/standard/var_unserializer.re
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unexpected end of 
serialized data);
@@ -607,7 +607,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 670 ext/standard/var_unserializer.re
+#line 693 ext/standard/var_unserializer.re
{
size_t len, len2, len3, maxlen;
long elements;
@@ -750,7 +750,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 662 ext/standard/var_unserializer.re
+#line 685 ext/standard/var_unserializer.re
{
 
INIT_PZVAL(*rval);
@@ -779,7 +779,7 @@
yych = *++YYCURSOR;
if (yych != '{') goto yy19;
++YYCURSOR;
-#line 642 ext/standard/var_unserializer.re
+#line 665 ext/standard/var_unserializer.re
{
long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -820,7 +820,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 613 ext/standard/var_unserializer.re
+#line 636 ext/standard/var_unserializer.re
{
size_t len, maxlen;
UChar *ustr;
@@ -870,7 +870,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 584 ext/standard/var_unserializer.re
+#line 607 ext/standard/var_unserializer.re
{
size_t len, maxlen;
char *str;
@@ -920,7 +920,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy19;
++YYCURSOR;
-#line 556 ext/standard/var_unserializer.re
+#line 579 ext/standard/var_unserializer.re
{
size_t len, maxlen;
char *str;
@@ -1036,14 +1036,17 @@
}
 yy71:
++YYCURSOR;
-#line 549 ext/standard/var_unserializer.re
+#line 569 ext/standard/var_unserializer.re
{
+#if SIZEOF_LONG == 4
+use_double:
+#endif
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
 }
-#line 1047 ext/standard/var_unserializer.c
+#line 1050 ext/standard/var_unserializer.c
 yy73:
yych = *++YYCURSOR;
if (yych = ',') {
@@ -1102,7 +1105,7 @@
yych = *++YYCURSOR;
if (yych != ';') goto yy19;
++YYCURSOR;
-#line 534 ext/standard/var_unserializer.re
+#line 554 ext/standard/var_unserializer.re
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -1117,7 +1120,7 @@
 
return 1;
 }
-#line 1121 ext/standard/var_unserializer.c
+#line 1124 ext/standard/var_unserializer.c
 yy84:
yych = *++YYCURSOR;
if (yych == 'N') goto yy81;
@@ -1146,12 +1149,32 @@
++YYCURSOR;
 #line 527 ext/standard/var_unserializer.re
{
+#if SIZEOF_LONG == 4
+   int digits = YYCURSOR - start - 3;
+
+   if (start[2] == '-' || start[2] == '+') {
+   

[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard var_unserializer.c var_unserializer.re /ext/standard/tests/serialize bug46882.phpt

2009-03-17 Thread Matt Wilmas
mattwil Tue Mar 17 22:04:57 2009 UTC

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

  Modified files:  
/php-srcNEWS 
/php-src/ext/standard   var_unserializer.c var_unserializer.re 
  Log:
  MFH: Fixed bug #46882 (Serialize / Unserialize misbehaviour under OS with 
different bit numbers)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1441r2=1.2027.2.547.2.1442diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1441 php-src/NEWS:1.2027.2.547.2.1442
--- php-src/NEWS:1.2027.2.547.2.1441Tue Mar 17 02:03:58 2009
+++ php-src/NEWSTue Mar 17 22:04:56 2009
@@ -18,6 +18,8 @@
   addresses in the filter extension). (Ilia)
 - Fixed bug #47430 (Errors after writing to nodeValue parameter of an absent 
   previousSibling). (Rob)
+- Fixed bug #46882 (Serialize / Unserialize misbehaviour under OS with 
different
+  bit numbers). (Matt)
 - Fixed bug #45799 (imagepng() crashes on empty image). (Martin McNickle,
   Takeshi Abe)
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var_unserializer.c?r1=1.70.2.4.2.10r2=1.70.2.4.2.11diff_format=u
Index: php-src/ext/standard/var_unserializer.c
diff -u php-src/ext/standard/var_unserializer.c:1.70.2.4.2.10 
php-src/ext/standard/var_unserializer.c:1.70.2.4.2.11
--- php-src/ext/standard/var_unserializer.c:1.70.2.4.2.10   Sat Oct  4 
13:11:36 2008
+++ php-src/ext/standard/var_unserializer.c Tue Mar 17 22:04:57 2009
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sat Oct  4 10:07:18 2008 */
+/* Generated by re2c 0.13.5 on Tue Mar 17 16:18:30 2009 */
 #line 1 ext/standard/var_unserializer.re
 /*
   +--+
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: var_unserializer.c,v 1.70.2.4.2.10 2008/10/04 13:11:36 felipe Exp $ */
+/* $Id: var_unserializer.c,v 1.70.2.4.2.11 2009/03/17 22:04:57 mattwil Exp $ */
 
 #include php.h
 #include ext/standard/php_var.h
@@ -458,7 +458,7 @@
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy95;
 yy3:
-#line 698 ext/standard/var_unserializer.re
+#line 721 ext/standard/var_unserializer.re
{ return 0; }
 #line 464 ext/standard/var_unserializer.c
 yy4:
@@ -503,7 +503,7 @@
goto yy3;
 yy14:
++YYCURSOR;
-#line 692 ext/standard/var_unserializer.re
+#line 715 ext/standard/var_unserializer.re
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, Unexpected end of 
serialized data);
@@ -539,7 +539,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy18;
++YYCURSOR;
-#line 580 ext/standard/var_unserializer.re
+#line 603 ext/standard/var_unserializer.re
{
size_t len, len2, len3, maxlen;
long elements;
@@ -676,7 +676,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy18;
++YYCURSOR;
-#line 572 ext/standard/var_unserializer.re
+#line 595 ext/standard/var_unserializer.re
{
 
INIT_PZVAL(*rval);
@@ -705,7 +705,7 @@
yych = *++YYCURSOR;
if (yych != '{') goto yy18;
++YYCURSOR;
-#line 550 ext/standard/var_unserializer.re
+#line 573 ext/standard/var_unserializer.re
{
long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -748,7 +748,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy18;
++YYCURSOR;
-#line 521 ext/standard/var_unserializer.re
+#line 544 ext/standard/var_unserializer.re
{
size_t len, maxlen;
char *str;
@@ -798,7 +798,7 @@
yych = *++YYCURSOR;
if (yych != '') goto yy18;
++YYCURSOR;
-#line 493 ext/standard/var_unserializer.re
+#line 516 ext/standard/var_unserializer.re
{
size_t len, maxlen;
char *str;
@@ -914,14 +914,17 @@
}
 yy63:
++YYCURSOR;
-#line 486 ext/standard/var_unserializer.re
+#line 506 ext/standard/var_unserializer.re
{
+#if SIZEOF_LONG == 4
+use_double:
+#endif
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
 }
-#line 925 ext/standard/var_unserializer.c
+#line 928 ext/standard/var_unserializer.c
 yy65:
yych = *++YYCURSOR;
if (yych = ',') {
@@ -980,7 +983,7 @@
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 471 ext/standard/var_unserializer.re
+#line 491 ext/standard/var_unserializer.re
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -995,7 +998,7 @@
 
return 1;
 }
-#line 999 ext/standard/var_unserializer.c
+#line 1002 ext/standard/var_unserializer.c
 yy76:
yych = *++YYCURSOR;
if (yych == 'N') goto yy73;
@@ -1024,12 +1027,32 @@
++YYCURSOR;
 #line 464 ext/standard/var_unserializer.re
 

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

2009-03-16 Thread Matt Wilmas
mattwil Tue Mar 17 00:02:40 2009 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   string.c 
  Log:
  Removed unneeded HashPosition variable (php_implode() doesn't change the 
internal pointer)
  - It was added in '06 with the 200-300% implode() optimization (hasn't been 
merged to HEAD)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.69.2.43r2=1.445.2.14.2.69.2.44diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.69.2.43 
php-src/ext/standard/string.c:1.445.2.14.2.69.2.44
--- php-src/ext/standard/string.c:1.445.2.14.2.69.2.43  Tue Mar  3 11:47:31 2009
+++ php-src/ext/standard/string.c   Tue Mar 17 00:02:39 2009
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: string.c,v 1.445.2.14.2.69.2.43 2009/03/03 11:47:31 kalle Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.69.2.44 2009/03/17 00:02:39 mattwil Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1130,7 +1130,6 @@
 PHP_FUNCTION(implode)
 {
zval **arg1 = NULL, **arg2 = NULL, *delim, *arr;
-   HashPosition pos;
 
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Z|Z, arg1, 
arg2) == FAILURE) {
return;
@@ -1162,13 +1161,9 @@
return;
}
}
-
-   pos = Z_ARRVAL_P(arr)-pInternalPointer;

php_implode(delim, arr, return_value TSRMLS_CC);
 
-   Z_ARRVAL_P(arr)-pInternalPointer = pos;
-
if (arg2 == NULL) {
FREE_ZVAL(delim);
}



-- 
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

2009-02-17 Thread Matt Wilmas
mattwil Tue Feb 17 14:28:16 2009 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
  Log:
  Entry for bug #47422
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1422r2=1.2027.2.547.2.1423diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1422 php-src/NEWS:1.2027.2.547.2.1423
--- php-src/NEWS:1.2027.2.547.2.1422Tue Feb 17 10:40:18 2009
+++ php-src/NEWSTue Feb 17 14:28:15 2009
@@ -1,6 +1,8 @@
 PHPNEWS
 |||
 ?? Feb 2009, PHP 5.2.9
+- Fixed bug #47422 (modulus operator returns incorrect results on 64 bit 
linux).
+  (Matt)
 - Fixed bug #47399 (mb_check_encoding() returns true for some illegal SJIS
   characters). (for-bugs at hnw dot jp, Moriyoshi)
 - Fixed bug #45940 (MySQLI OO does not populate connect_error property on



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



[PHP-CVS] cvs: php-src /sapi/cgi fastcgi.c

2008-12-07 Thread Matt Wilmas
mattwil Sun Dec  7 10:54:16 2008 UTC

  Modified files:  
/php-src/sapi/cgi   fastcgi.c 
  Log:
  Fixed bug #46782 (fastcgi.c parse error)
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.49r2=1.50diff_format=u
Index: php-src/sapi/cgi/fastcgi.c
diff -u php-src/sapi/cgi/fastcgi.c:1.49 php-src/sapi/cgi/fastcgi.c:1.50
--- php-src/sapi/cgi/fastcgi.c:1.49 Tue Oct 21 03:19:07 2008
+++ php-src/sapi/cgi/fastcgi.c  Sun Dec  7 10:54:16 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: fastcgi.c,v 1.49 2008/10/21 03:19:07 lbarnaud Exp $ */
+/* $Id: fastcgi.c,v 1.50 2008/12/07 10:54:16 mattwil Exp $ */
 
 #include php.h
 #include fastcgi.h
@@ -191,8 +191,14 @@
 int fcgi_init(void)
 {
if (!is_initialized) {
+#ifndef _WIN32
+   sa_t sa;
+   socklen_t len = sizeof(sa);
+#endif
zend_hash_init(fcgi_mgmt_vars, 0, NULL, fcgi_free_mgmt_var_cb, 
1);
fcgi_set_mgmt_var(FCGI_MPXS_CONNS, 
sizeof(FCGI_MPXS_CONNS)-1, 0, sizeof(0)-1);
+
+   is_initialized = 1;
 #ifdef _WIN32
 # if 0
/* TODO: Support for TCP sockets */
@@ -203,8 +209,6 @@
return 0;
}
 # endif
-   is_initialized = 1;
-
if ((GetStdHandle(STD_OUTPUT_HANDLE) == INVALID_HANDLE_VALUE) 
(GetStdHandle(STD_ERROR_HANDLE)  == INVALID_HANDLE_VALUE) 
(GetStdHandle(STD_INPUT_HANDLE)  != INVALID_HANDLE_VALUE)) {
@@ -231,10 +235,6 @@
return is_fastcgi = 0;
}
 #else
-   sa_t sa;
-   socklen_t len = sizeof(sa);
-
-   is_initialized = 1;
errno = 0;
if (getpeername(0, (struct sockaddr *)sa, len) != 0  errno 
== ENOTCONN) {
fcgi_setup_signals();



-- 
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 /sapi/cgi fastcgi.c

2008-12-07 Thread Matt Wilmas
mattwil Sun Dec  7 10:55:47 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/sapi/cgi   fastcgi.c 
  Log:
  MFH: Fixed bug #46782 (fastcgi.c parse error)
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1348r2=1.2027.2.547.2.1349diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1348 php-src/NEWS:1.2027.2.547.2.1349
--- php-src/NEWS:1.2027.2.547.2.1348Thu Dec  4 13:17:28 2008
+++ php-src/NEWSSun Dec  7 10:55:47 2008
@@ -1,6 +1,7 @@
 PHPNEWS
 |||
 ?? ??? 2009, PHP 5.2.8
+- Fixed bug #46782 (fastcgi.c parse error). (Matt)
 - Fixed bug #46739 (array returned by curl_getinfo should contain content_type 
key). 
   (Mikko)
 
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.4.2.13.2.32r2=1.4.2.13.2.33diff_format=u
Index: php-src/sapi/cgi/fastcgi.c
diff -u php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.32 
php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.33
--- php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.32Tue Oct 21 16:43:59 2008
+++ php-src/sapi/cgi/fastcgi.c  Sun Dec  7 10:55:47 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: fastcgi.c,v 1.4.2.13.2.32 2008/10/21 16:43:59 lbarnaud Exp $ */
+/* $Id: fastcgi.c,v 1.4.2.13.2.33 2008/12/07 10:55:47 mattwil Exp $ */
 
 #include php.h
 #include fastcgi.h
@@ -183,8 +183,14 @@
 int fcgi_init(void)
 {
if (!is_initialized) {
+#ifndef _WIN32
+   sa_t sa;
+   socklen_t len = sizeof(sa);
+#endif
zend_hash_init(fcgi_mgmt_vars, 0, NULL, fcgi_free_mgmt_var_cb, 
1);
fcgi_set_mgmt_var(FCGI_MPXS_CONNS, 
sizeof(FCGI_MPXS_CONNS)-1, 0, sizeof(0)-1);
+
+   is_initialized = 1;
 #ifdef _WIN32
 # if 0
/* TODO: Support for TCP sockets */
@@ -195,8 +201,6 @@
return 0;
}
 # endif
-   is_initialized = 1;
-
if ((GetStdHandle(STD_OUTPUT_HANDLE) == INVALID_HANDLE_VALUE) 
(GetStdHandle(STD_ERROR_HANDLE)  == INVALID_HANDLE_VALUE) 
(GetStdHandle(STD_INPUT_HANDLE)  != INVALID_HANDLE_VALUE)) {
@@ -223,10 +227,6 @@
return is_fastcgi = 0;
}
 #else
-   sa_t sa;
-   socklen_t len = sizeof(sa);
-
-   is_initialized = 1;
errno = 0;
if (getpeername(0, (struct sockaddr *)sa, len) != 0  errno 
== ENOTCONN) {
fcgi_setup_signals();



-- 
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) /sapi/cgi fastcgi.c

2008-12-07 Thread Matt Wilmas
mattwil Sun Dec  7 10:55:17 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/sapi/cgi   fastcgi.c 
  Log:
  MFH: Fixed bug #46782 (fastcgi.c parse error)
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.4.2.13.2.28.2.7r2=1.4.2.13.2.28.2.8diff_format=u
Index: php-src/sapi/cgi/fastcgi.c
diff -u php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.28.2.7 
php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.28.2.8
--- php-src/sapi/cgi/fastcgi.c:1.4.2.13.2.28.2.7Tue Oct 21 03:19:28 2008
+++ php-src/sapi/cgi/fastcgi.c  Sun Dec  7 10:55:16 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: fastcgi.c,v 1.4.2.13.2.28.2.7 2008/10/21 03:19:28 lbarnaud Exp $ */
+/* $Id: fastcgi.c,v 1.4.2.13.2.28.2.8 2008/12/07 10:55:16 mattwil Exp $ */
 
 #include php.h
 #include fastcgi.h
@@ -183,8 +183,14 @@
 int fcgi_init(void)
 {
if (!is_initialized) {
+#ifndef _WIN32
+   sa_t sa;
+   socklen_t len = sizeof(sa);
+#endif
zend_hash_init(fcgi_mgmt_vars, 0, NULL, fcgi_free_mgmt_var_cb, 
1);
fcgi_set_mgmt_var(FCGI_MPXS_CONNS, 
sizeof(FCGI_MPXS_CONNS)-1, 0, sizeof(0)-1);
+
+   is_initialized = 1;
 #ifdef _WIN32
 # if 0
/* TODO: Support for TCP sockets */
@@ -195,8 +201,6 @@
return 0;
}
 # endif
-   is_initialized = 1;
-
if ((GetStdHandle(STD_OUTPUT_HANDLE) == INVALID_HANDLE_VALUE) 
(GetStdHandle(STD_ERROR_HANDLE)  == INVALID_HANDLE_VALUE) 
(GetStdHandle(STD_INPUT_HANDLE)  != INVALID_HANDLE_VALUE)) {
@@ -223,10 +227,6 @@
return is_fastcgi = 0;
}
 #else
-   sa_t sa;
-   socklen_t len = sizeof(sa);
-
-   is_initialized = 1;
errno = 0;
if (getpeername(0, (struct sockaddr *)sa, len) != 0  errno 
== ENOTCONN) {
fcgi_setup_signals();



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



[PHP-CVS] cvs: php-src /ext/json JSON_parser.c

2008-12-02 Thread Matt Wilmas
mattwil Tue Dec  2 14:50:01 2008 UTC

  Modified files:  
/php-src/ext/json   JSON_parser.c 
  Log:
  Changed logic for LONG_MIN
  
http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.18r2=1.19diff_format=u
Index: php-src/ext/json/JSON_parser.c
diff -u php-src/ext/json/JSON_parser.c:1.18 php-src/ext/json/JSON_parser.c:1.19
--- php-src/ext/json/JSON_parser.c:1.18 Wed Jul 30 13:57:47 2008
+++ php-src/ext/json/JSON_parser.c  Tue Dec  2 14:50:01 2008
@@ -278,7 +278,7 @@
 
if (type == IS_LONG) {
double d = zend_strtod(buf-c, NULL);
-   if (d  LONG_MAX || d  -LONG_MAX) {
+   if (d  LONG_MAX || d  LONG_MIN) {
ZVAL_DOUBLE(*z, d);
} else {
ZVAL_LONG(*z, (long)d);



-- 
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/json JSON_parser.c

2008-12-02 Thread Matt Wilmas
mattwil Tue Dec  2 14:50:22 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/json   JSON_parser.c 
  Log:
  MFH: Changed logic for LONG_MIN
  
http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.1.2.12.2.2r2=1.1.2.12.2.3diff_format=u
Index: php-src/ext/json/JSON_parser.c
diff -u php-src/ext/json/JSON_parser.c:1.1.2.12.2.2 
php-src/ext/json/JSON_parser.c:1.1.2.12.2.3
--- php-src/ext/json/JSON_parser.c:1.1.2.12.2.2 Wed Jul 30 13:52:59 2008
+++ php-src/ext/json/JSON_parser.c  Tue Dec  2 14:50:22 2008
@@ -285,7 +285,7 @@
 if (type == IS_LONG)
 {
double d = zend_strtod(buf-c, NULL);
-   if (d  LONG_MAX || d  -LONG_MAX) {
+   if (d  LONG_MAX || d  LONG_MIN) {
ZVAL_DOUBLE(*z, d);
} else {
ZVAL_LONG(*z, (long)d);



-- 
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/json JSON_parser.c

2008-12-02 Thread Matt Wilmas
mattwil Tue Dec  2 14:50:37 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/json   JSON_parser.c 
  Log:
  MFH: Changed logic for LONG_MIN
  
http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.1.2.13r2=1.1.2.14diff_format=u
Index: php-src/ext/json/JSON_parser.c
diff -u php-src/ext/json/JSON_parser.c:1.1.2.13 
php-src/ext/json/JSON_parser.c:1.1.2.14
--- php-src/ext/json/JSON_parser.c:1.1.2.13 Wed Jul 30 13:55:27 2008
+++ php-src/ext/json/JSON_parser.c  Tue Dec  2 14:50:37 2008
@@ -285,7 +285,7 @@
 if (type == IS_LONG)
 {
double d = zend_strtod(buf-c, NULL);
-   if (d  LONG_MAX || d  -LONG_MAX) {
+   if (d  LONG_MAX || d  LONG_MIN) {
ZVAL_DOUBLE(*z, d);
} else {
ZVAL_LONG(*z, (long)d);



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



[PHP-CVS] cvs: php-src /ext/pdo pdo_dbh.c

2008-12-02 Thread Matt Wilmas
mattwil Wed Dec  3 00:08:38 2008 UTC

  Modified files:  
/php-src/ext/pdopdo_dbh.c 
  Log:
  MFB (1.82.2.31.2.17.2.10): Added a warning message on pdo::exec() failure in 
the event of an empty query
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_dbh.c?r1=1.157r2=1.158diff_format=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.157 php-src/ext/pdo/pdo_dbh.c:1.158
--- php-src/ext/pdo/pdo_dbh.c:1.157 Thu Nov 27 19:02:44 2008
+++ php-src/ext/pdo/pdo_dbh.c   Wed Dec  3 00:08:37 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_dbh.c,v 1.157 2008/11/27 19:02:44 dmitry Exp $ */
+/* $Id: pdo_dbh.c,v 1.158 2008/12/03 00:08:37 mattwil Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -930,6 +930,7 @@
}
 
if (!statement_len) {
+   pdo_raise_impl_error(dbh, NULL, HY000,  trying to execute an 
empty query TSRMLS_CC);
RETURN_FALSE;
}
PDO_DBH_CLEAR_ERR();



-- 
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/pdo pdo_dbh.c

2008-12-02 Thread Matt Wilmas
mattwil Wed Dec  3 00:10:17 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/pdopdo_dbh.c 
  Log:
  Fixed error message typo
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo/pdo_dbh.c?r1=1.82.2.31.2.17.2.17r2=1.82.2.31.2.17.2.18diff_format=u
Index: php-src/ext/pdo/pdo_dbh.c
diff -u php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.17.2.17 
php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.17.2.18
--- php-src/ext/pdo/pdo_dbh.c:1.82.2.31.2.17.2.17   Thu Nov 27 19:01:22 2008
+++ php-src/ext/pdo/pdo_dbh.c   Wed Dec  3 00:10:17 2008
@@ -18,7 +18,7 @@
   +--+
 */
 
-/* $Id: pdo_dbh.c,v 1.82.2.31.2.17.2.17 2008/11/27 19:01:22 dmitry Exp $ */
+/* $Id: pdo_dbh.c,v 1.82.2.31.2.17.2.18 2008/12/03 00:10:17 mattwil Exp $ */
 
 /* The PDO Database Handle Class */
 
@@ -923,7 +923,7 @@
}
 
if (!statement_len) {
-   pdo_raise_impl_error(dbh, NULL, HY000,  trying to execute 
and empty query TSRMLS_CC);
+   pdo_raise_impl_error(dbh, NULL, HY000,  trying to execute an 
empty query TSRMLS_CC);
RETURN_FALSE;
}
PDO_DBH_CLEAR_ERR();



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



[PHP-CVS] cvs: php-src / php.ini-dist php.ini-recommended

2008-11-28 Thread Matt Wilmas
mattwil Fri Nov 28 19:05:43 2008 UTC

  Modified files:  
/php-srcphp.ini-dist php.ini-recommended 
  Log:
  Updated description to match docs
  
http://cvs.php.net/viewvc.cgi/php-src/php.ini-dist?r1=1.281r2=1.282diff_format=u
Index: php-src/php.ini-dist
diff -u php-src/php.ini-dist:1.281 php-src/php.ini-dist:1.282
--- php-src/php.ini-dist:1.281  Thu Nov 13 19:05:36 2008
+++ php-src/php.ini-distFri Nov 28 19:05:42 2008
@@ -297,7 +297,7 @@
 log_errors_max_len = 1024
 
 ; Do not log repeated messages. Repeated errors must occur in same file on same
-; line until ignore_repeated_source is set true.
+; line unless ignore_repeated_source is set true.
 ignore_repeated_errors = Off
 
 ; Ignore source of message when ignoring repeated messages. When this setting
http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?r1=1.231r2=1.232diff_format=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.231 php-src/php.ini-recommended:1.232
--- php-src/php.ini-recommended:1.231   Thu Nov 13 19:05:36 2008
+++ php-src/php.ini-recommended Fri Nov 28 19:05:42 2008
@@ -336,7 +336,7 @@
 log_errors_max_len = 1024
 
 ; Do not log repeated messages. Repeated errors must occur in same file on same
-; line until ignore_repeated_source is set true.
+; line unless ignore_repeated_source is set true.
 ignore_repeated_errors = Off
 
 ; Ignore source of message when ignoring repeated messages. When this setting



-- 
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) / php.ini-dist php.ini-recommended

2008-11-28 Thread Matt Wilmas
mattwil Fri Nov 28 19:06:10 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcphp.ini-dist php.ini-recommended 
  Log:
  MFH: Updated description to match docs
  
http://cvs.php.net/viewvc.cgi/php-src/php.ini-dist?r1=1.231.2.10.2.22.2.11r2=1.231.2.10.2.22.2.12diff_format=u
Index: php-src/php.ini-dist
diff -u php-src/php.ini-dist:1.231.2.10.2.22.2.11 
php-src/php.ini-dist:1.231.2.10.2.22.2.12
--- php-src/php.ini-dist:1.231.2.10.2.22.2.11   Thu Nov 13 19:06:28 2008
+++ php-src/php.ini-distFri Nov 28 19:06:10 2008
@@ -347,7 +347,7 @@
 log_errors_max_len = 1024
 
 ; Do not log repeated messages. Repeated errors must occur in same file on same
-; line until ignore_repeated_source is set true.
+; line unless ignore_repeated_source is set true.
 ignore_repeated_errors = Off
 
 ; Ignore source of message when ignoring repeated messages. When this setting
http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?r1=1.179.2.11.2.23.2.12r2=1.179.2.11.2.23.2.13diff_format=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.179.2.11.2.23.2.12 
php-src/php.ini-recommended:1.179.2.11.2.23.2.13
--- php-src/php.ini-recommended:1.179.2.11.2.23.2.12Thu Nov 13 19:06:28 2008
+++ php-src/php.ini-recommended Fri Nov 28 19:06:10 2008
@@ -399,7 +399,7 @@
 log_errors_max_len = 1024
 
 ; Do not log repeated messages. Repeated errors must occur in same file on same
-; line until ignore_repeated_source is set true.
+; line unless ignore_repeated_source is set true.
 ignore_repeated_errors = Off
 
 ; Ignore source of message when ignoring repeated messages. When this setting



-- 
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) / php.ini-dist php.ini-recommended

2008-11-28 Thread Matt Wilmas
mattwil Fri Nov 28 19:07:10 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcphp.ini-dist php.ini-recommended 
  Log:
  MFH: Updated description to match docs
  
http://cvs.php.net/viewvc.cgi/php-src/php.ini-dist?r1=1.231.2.10.2.24r2=1.231.2.10.2.25diff_format=u
Index: php-src/php.ini-dist
diff -u php-src/php.ini-dist:1.231.2.10.2.24 
php-src/php.ini-dist:1.231.2.10.2.25
--- php-src/php.ini-dist:1.231.2.10.2.24Thu Nov 13 19:06:59 2008
+++ php-src/php.ini-distFri Nov 28 19:07:09 2008
@@ -336,7 +336,7 @@
 log_errors_max_len = 1024
 
 ; Do not log repeated messages. Repeated errors must occur in same file on same
-; line until ignore_repeated_source is set true.
+; line unless ignore_repeated_source is set true.
 ignore_repeated_errors = Off
 
 ; Ignore source of message when ignoring repeated messages. When this setting
http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?r1=1.179.2.11.2.26r2=1.179.2.11.2.27diff_format=u
Index: php-src/php.ini-recommended
diff -u php-src/php.ini-recommended:1.179.2.11.2.26 
php-src/php.ini-recommended:1.179.2.11.2.27
--- php-src/php.ini-recommended:1.179.2.11.2.26 Thu Nov 13 19:06:59 2008
+++ php-src/php.ini-recommended Fri Nov 28 19:07:09 2008
@@ -387,7 +387,7 @@
 log_errors_max_len = 1024
 
 ; Do not log repeated messages. Repeated errors must occur in same file on same
-; line until ignore_repeated_source is set true.
+; line unless ignore_repeated_source is set true.
 ignore_repeated_errors = Off
 
 ; Ignore source of message when ignoring repeated messages. When this setting



-- 
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) / NEWS

2008-08-29 Thread Matt Wilmas
mattwil Fri Aug 29 11:12:34 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-srcNEWS 
  Log:
  - Be more specific about when constant substitution occurs
  - And should that be values or value? Hmm, feel free to improve wording
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.965.2.290r2=1.2027.2.547.2.965.2.291diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.965.2.290 
php-src/NEWS:1.2027.2.547.2.965.2.291
--- php-src/NEWS:1.2027.2.547.2.965.2.290   Thu Aug 28 06:22:49 2008
+++ php-src/NEWSFri Aug 29 11:12:34 2008
@@ -105,7 +105,8 @@
   . Added ability to handle exceptions in destructors. (Marcus)
 
 - Improved PHP runtime speed and memory usage:
-  . Substitute persistent constants by their values at compile time. (Matt)
+  . Substitute global-scope, persistent constants with their values at compile
+time. (Matt)
   . Optimized ZEND_SIGNED_MULTIPLY_LONG(). (Matt)
   . Removed direct executor recursion. (Dmitry)
   . Use fastcall calling convention in executor on x86. (Dmitry)



-- 
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) /win32/build config.w32

2008-07-14 Thread Matt Wilmas
mattwil Mon Jul 14 10:15:31 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/win32/buildconfig.w32 
  Log:
  MFH: Prevent build failure after closures
  
http://cvs.php.net/viewvc.cgi/php-src/win32/build/config.w32?r1=1.40.2.8.2.10.2.26r2=1.40.2.8.2.10.2.27diff_format=u
Index: php-src/win32/build/config.w32
diff -u php-src/win32/build/config.w32:1.40.2.8.2.10.2.26 
php-src/win32/build/config.w32:1.40.2.8.2.10.2.27
--- php-src/win32/build/config.w32:1.40.2.8.2.10.2.26   Sun Jul 13 09:34:08 2008
+++ php-src/win32/build/config.w32  Mon Jul 14 10:15:31 2008
@@ -1,5 +1,5 @@
 // vim:ft=javascript
-// $Id: config.w32,v 1.40.2.8.2.10.2.26 2008/07/13 09:34:08 pajoye Exp $
+// $Id: config.w32,v 1.40.2.8.2.10.2.27 2008/07/14 10:15:31 mattwil Exp $
 // Master config file; think of it as a configure.in
 // equivalent.
 
@@ -307,7 +307,7 @@
zend_sprintf.c zend_ini.c zend_qsort.c zend_multibyte.c zend_ts_hash.c \
zend_stream.c zend_iterators.c zend_interfaces.c zend_objects.c \
zend_object_handlers.c zend_objects_API.c \
-   zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c);
+   zend_default_classes.c zend_execute.c zend_strtod.c zend_gc.c 
zend_closures.c);
 
 ADD_SOURCES(main, main.c snprintf.c spprintf.c safe_mode.c getopt.c 
fopen_wrappers.c \
php_scandir.c php_ini.c SAPI.c rfc1867.c php_content_types.c strlcpy.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/standard array.c

2008-06-02 Thread Matt Wilmas
mattwil Mon Jun  2 11:20:59 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   array.c 
  Log:
  MFH: Initialize with length instead of 0
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.37.2.33r2=1.308.2.21.2.37.2.34diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.37.2.33 
php-src/ext/standard/array.c:1.308.2.21.2.37.2.34
--- php-src/ext/standard/array.c:1.308.2.21.2.37.2.33   Mon Jun  2 10:27:55 2008
+++ php-src/ext/standard/array.cMon Jun  2 11:20:59 2008
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.37.2.33 2008/06/02 10:27:55 tony2001 Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.37.2.34 2008/06/02 11:20:59 mattwil Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -2111,7 +2111,7 @@
/* Don't create the array of removed elements if it's not going
 * to be used; e.g. only removing and/or replacing elements */
if (return_value_used) {
-   int size = 0;
+   int size = length;
 
/* Clamp the offset.. */
if (offset  num_in) {



-- 
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

2008-06-02 Thread Matt Wilmas
mattwil Mon Jun  2 11:20:17 2008 UTC

  Modified files:  
/php-src/ext/standard   array.c 
  Log:
  Initialize with length instead of 0 (and thanks Antony for finding)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.453r2=1.454diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.453 php-src/ext/standard/array.c:1.454
--- php-src/ext/standard/array.c:1.453  Mon Jun  2 10:27:42 2008
+++ php-src/ext/standard/array.cMon Jun  2 11:20:17 2008
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.453 2008/06/02 10:27:42 tony2001 Exp $ */
+/* $Id: array.c,v 1.454 2008/06/02 11:20:17 mattwil Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -2298,7 +2298,7 @@
/* Don't create the array of removed elements if it's not going
 * to be used; e.g. only removing and/or replacing elements */
if (return_value_used) {
-   int size = 0;
+   int size = length;
 
/* Clamp the offset.. */
if (offset  num_in) {



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



[PHP-CVS] cvs: php-src /sapi/apache2handler config.w32

2008-06-01 Thread Matt Wilmas
mattwil Sun Jun  1 14:01:07 2008 UTC

  Modified files:  
/php-src/sapi/apache2handlerconfig.w32 
  Log:
  Fixed build
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/apache2handler/config.w32?r1=1.5r2=1.6diff_format=u
Index: php-src/sapi/apache2handler/config.w32
diff -u php-src/sapi/apache2handler/config.w32:1.5 
php-src/sapi/apache2handler/config.w32:1.6
--- php-src/sapi/apache2handler/config.w32:1.5  Wed May 14 03:32:27 2008
+++ php-src/sapi/apache2handler/config.w32  Sun Jun  1 14:01:07 2008
@@ -1,5 +1,5 @@
 // vim:ft=javascript
-// $Id: config.w32,v 1.5 2008/05/14 03:32:27 auroraeosrose Exp $
+// $Id: config.w32,v 1.6 2008/06/01 14:01:07 mattwil Exp $
 
 ARG_ENABLE('apache2handler', 'Build Apache 2.x handler', 'no');
 
@@ -11,7 +11,7 @@
CHECK_LIB(libapr.lib, apache2handler, PHP_PHP_BUILD 
+ \\lib\\apache2) 
CHECK_LIB(libaprutil.lib, apache2handler, 
PHP_PHP_BUILD + \\lib\\apache2)
) {
-   SAPI('apache2handler', 'mod_php5.c sapi_apache2.c 
apache_config.c php_functions.c',
+   SAPI('apache2handler', 'mod_php.c sapi_apache2.c 
apache_config.c php_functions.c',
'php' + PHP_VERSION + 'apache2.dll',
'/D PHP_APACHE2_EXPORTS /I win32');
} else {
@@ -29,7 +29,7 @@
CHECK_LIB(libapr-1.lib, apache2_2handler, 
PHP_PHP_BUILD + \\lib\\apache2_2) 
CHECK_LIB(libaprutil-1.lib, apache2_2handler, 
PHP_PHP_BUILD + \\lib\\apache2_2)
) {
-   SAPI('apache2_2handler', 'mod_php5.c sapi_apache2.c 
apache_config.c php_functions.c',
+   SAPI('apache2_2handler', 'mod_php.c sapi_apache2.c 
apache_config.c php_functions.c',
'php' + PHP_VERSION + 'apache2_2.dll',
'/D PHP_APACHE2_EXPORTS /I win32',
'sapi\\apache2_2handler');



-- 
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

2008-05-30 Thread Matt Wilmas
mattwil Fri May 30 10:54:17 2008 UTC

  Modified files:  
/php-src/ext/standard   array.c 
  Log:
  Only check args once in php_array_diff_key/intersect_key, not on each 
iteration. This also makes sure ALL args are checked (pre-5.2.5 behavior)
  - Also, use new hash_quick_del function where possible
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.451r2=1.452diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.451 php-src/ext/standard/array.c:1.452
--- php-src/ext/standard/array.c:1.451  Tue May 27 10:28:25 2008
+++ php-src/ext/standard/array.cFri May 30 10:54:16 2008
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.451 2008/05/27 10:28:25 mattwil Exp $ */
+/* $Id: array.c,v 1.452 2008/05/30 10:54:16 mattwil Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -2978,7 +2978,7 @@
if (Z_ARRVAL_P(return_value) == 
EG(symbol_table)) {

zend_u_delete_global_variable(p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength 
- 1 TSRMLS_CC);
} else {
-   
zend_u_hash_del(Z_ARRVAL_P(return_value), p-key.type, ZSTR(p-key.arKey.s), 
p-nKeyLength);
+   
zend_u_hash_quick_del(Z_ARRVAL_P(return_value), p-key.type, 
ZSTR(p-key.arKey.s), p-nKeyLength, p-h);
}
}
}
@@ -3075,10 +3075,12 @@
}
}
 
-   if (Z_TYPE_PP(args[0]) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument #1 is not 
an array);
-   RETVAL_NULL();
-   goto out;
+   for (i = 0; i  argc; i++) {
+   if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument 
#%d is not an array, i + 1);
+   RETVAL_NULL();
+   goto out;
+   }
}
 
array_init(return_value);
@@ -3087,12 +3089,7 @@
if (p-nKeyLength == 0) {
ok = 1;
for (i = 1; i  argc; i++) {
-   if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, Argument #%d is not an array, i + 1);
-   zval_dtor(return_value);
-   RETVAL_NULL();
-   goto out;
-   } else if 
(zend_hash_index_find(Z_ARRVAL_PP(args[i]), p-h, (void**)data) == FAILURE ||
+   if (zend_hash_index_find(Z_ARRVAL_PP(args[i]), 
p-h, (void**)data) == FAILURE ||
(intersect_data_compare_func 

intersect_data_compare_func((zval**)p-pData, data TSRMLS_CC) != 0)
) {
@@ -3107,12 +3104,7 @@
} else {
ok = 1;
for (i = 1; i  argc; i++) {
-   if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, Argument #%d is not an array, i + 1);
-   zval_dtor(return_value);
-   RETVAL_NULL();
-   goto out;
-   } else if 
(zend_u_hash_quick_find(Z_ARRVAL_PP(args[i]), p-key.type, 
ZSTR(p-key.arKey.s), p-nKeyLength, p-h, (void**)data) == FAILURE ||
+   if 
(zend_u_hash_quick_find(Z_ARRVAL_PP(args[i]), p-key.type, 
ZSTR(p-key.arKey.s), p-nKeyLength, p-h, (void**)data) == FAILURE ||
(intersect_data_compare_func 

intersect_data_compare_func((zval**)p-pData, data TSRMLS_CC) != 0)
) {
@@ -3342,7 +3334,7 @@
if (p-nKeyLength == 0) {

zend_hash_index_del(Z_ARRVAL_P(return_value), p-h);
} else {
-   
zend_u_hash_del(Z_ARRVAL_P(return_value), p-key.type, ZSTR(p-key.arKey.s), 
p-nKeyLength);
+   
zend_u_hash_quick_del(Z_ARRVAL_P(return_value), p-key.type, 
ZSTR(p-key.arKey.s), p-nKeyLength, p-h);
}
}
}
@@ -3358,7 +3350,7 @@
if (p-nKeyLength == 0) {

zend_hash_index_del(Z_ARRVAL_P(return_value), p-h);
} else {
- 

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

2008-05-30 Thread Matt Wilmas
mattwil Fri May 30 10:55:15 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   array.c 
  Log:
  MFH: Only check args once in php_array_diff_key/intersect_key, not on each 
iteration. This also makes sure ALL args are checked (pre-5.2.5 behavior)
  - Also, use new hash_quick_del function where possible
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.37.2.31r2=1.308.2.21.2.37.2.32diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.37.2.31 
php-src/ext/standard/array.c:1.308.2.21.2.37.2.32
--- php-src/ext/standard/array.c:1.308.2.21.2.37.2.31   Tue May 27 10:29:33 2008
+++ php-src/ext/standard/array.cFri May 30 10:55:14 2008
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.37.2.31 2008/05/27 10:29:33 mattwil Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.37.2.32 2008/05/30 10:55:14 mattwil Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -2754,7 +2754,7 @@
if (Z_ARRVAL_P(return_value) == 
EG(symbol_table)) {
zend_delete_global_variable(p-arKey, 
p-nKeyLength - 1 TSRMLS_CC);
} else {
-   zend_hash_del(Z_ARRVAL_P(return_value), 
p-arKey, p-nKeyLength);
+   
zend_hash_quick_del(Z_ARRVAL_P(return_value), p-arKey, p-nKeyLength, p-h);
}
}
}
@@ -2851,10 +2851,12 @@
}
}
 
-   if (Z_TYPE_PP(args[0]) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument #1 is not 
an array);
-   RETVAL_NULL();
-   goto out;
+   for (i = 0; i  argc; i++) {
+   if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument 
#%d is not an array, i + 1);
+   RETVAL_NULL();
+   goto out;
+   }
}
 
array_init(return_value);
@@ -2863,12 +2865,7 @@
if (p-nKeyLength == 0) {
ok = 1;
for (i = 1; i  argc; i++) {
-   if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, Argument #%d is not an array, i + 1);
-   zval_dtor(return_value);
-   RETVAL_NULL();
-   goto out;
-   } else if 
(zend_hash_index_find(Z_ARRVAL_PP(args[i]), p-h, (void**)data) == FAILURE ||
+   if (zend_hash_index_find(Z_ARRVAL_PP(args[i]), 
p-h, (void**)data) == FAILURE ||
(intersect_data_compare_func 

intersect_data_compare_func((zval**)p-pData, data TSRMLS_CC) != 0)
) {
@@ -2883,12 +2880,7 @@
} else {
ok = 1;
for (i = 1; i  argc; i++) {
-   if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, Argument #%d is not an array, i + 1);
-   zval_dtor(return_value);
-   RETVAL_NULL();
-   goto out;
-   } else if 
(zend_hash_quick_find(Z_ARRVAL_PP(args[i]), p-arKey, p-nKeyLength, p-h, 
(void**)data) == FAILURE ||
+   if (zend_hash_quick_find(Z_ARRVAL_PP(args[i]), 
p-arKey, p-nKeyLength, p-h, (void**)data) == FAILURE ||
(intersect_data_compare_func 

intersect_data_compare_func((zval**)p-pData, data TSRMLS_CC) != 0)
) {
@@ -3118,7 +3110,7 @@
if (p-nKeyLength == 0) {

zend_hash_index_del(Z_ARRVAL_P(return_value), p-h);
} else {
-   
zend_hash_del(Z_ARRVAL_P(return_value), p-arKey, p-nKeyLength);
+   
zend_hash_quick_del(Z_ARRVAL_P(return_value), p-arKey, p-nKeyLength, p-h);
}
}
}
@@ -3134,7 +3126,7 @@
if (p-nKeyLength == 0) {

zend_hash_index_del(Z_ARRVAL_P(return_value), p-h);
} else {
-   

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

2008-05-30 Thread Matt Wilmas
mattwil Fri May 30 10:55:44 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   array.c 
  Log:
  MFH: Only check args once in php_array_diff_key/intersect_key, not on each 
iteration. This also makes sure ALL args are checked (pre-5.2.5 behavior)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.56r2=1.308.2.21.2.57diff_format=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.308.2.21.2.56 
php-src/ext/standard/array.c:1.308.2.21.2.57
--- php-src/ext/standard/array.c:1.308.2.21.2.56Sun May 18 21:50:58 2008
+++ php-src/ext/standard/array.cFri May 30 10:55:44 2008
@@ -21,7 +21,7 @@
+--+
 */
 
-/* $Id: array.c,v 1.308.2.21.2.56 2008/05/18 21:50:58 felipe Exp $ */
+/* $Id: array.c,v 1.308.2.21.2.57 2008/05/30 10:55:44 mattwil Exp $ */
 
 #include php.h
 #include php_ini.h
@@ -2992,10 +2992,12 @@
intersect_data_compare_func = zval_compare;
}
 
-   if (Z_TYPE_PP(args[0]) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument #1 is not 
an array);
-   RETVAL_NULL();
-   goto out;
+   for (i = 0; i  argc; i++) {
+   if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument 
#%d is not an array, i + 1);
+   RETVAL_NULL();
+   goto out;
+   }
}
 
array_init(return_value);
@@ -3004,12 +3006,7 @@
if (p-nKeyLength == 0) {
ok = 1;
for (i = 1; i  argc; i++) {
-   if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, Argument #%d is not an array, i + 1);
-   zval_dtor(return_value);
-   RETVAL_NULL();
-   goto out;
-   } else if 
(zend_hash_index_find(Z_ARRVAL_PP(args[i]), p-h, (void**)data) == FAILURE ||
+   if (zend_hash_index_find(Z_ARRVAL_PP(args[i]), 
p-h, (void**)data) == FAILURE ||
(intersect_data_compare_func 
 
intersect_data_compare_func((zval**)p-pData, data TSRMLS_CC) != 0)) {
ok = 0;
@@ -3023,12 +3020,7 @@
} else {
ok = 1;
for (i = 1; i  argc; i++) {
-   if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, Argument #%d is not an array, i + 1);
-   zval_dtor(return_value);
-   RETVAL_NULL();
-   goto out;
-   } else if 
(zend_hash_quick_find(Z_ARRVAL_PP(args[i]), p-arKey, p-nKeyLength, p-h, 
(void**)data) == FAILURE ||
+   if (zend_hash_quick_find(Z_ARRVAL_PP(args[i]), 
p-arKey, p-nKeyLength, p-h, (void**)data) == FAILURE ||
(intersect_data_compare_func 
 
intersect_data_compare_func((zval**)p-pData, data TSRMLS_CC) != 0)) {
ok = 0;
@@ -3470,10 +3462,12 @@
diff_data_compare_func = zval_compare;
}
 
-   if (Z_TYPE_PP(args[0]) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument #1 is not 
an array);
-   RETVAL_NULL();
-   goto out;
+   for (i = 0; i  argc; i++) {
+   if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument 
#%d is not an array, i + 1);
+   RETVAL_NULL();
+   goto out;
+   }
}

array_init(return_value);
@@ -3482,12 +3476,7 @@
if (p-nKeyLength == 0) {
ok = 1;
for (i = 1; i  argc; i++) {
-   if (Z_TYPE_PP(args[i]) != IS_ARRAY) {
-   php_error_docref(NULL TSRMLS_CC, 
E_WARNING, Argument #%d is not an array, i + 1);
-   zval_dtor(return_value);
-   RETVAL_NULL();
-   goto out;
-   } else if 
(zend_hash_index_find(Z_ARRVAL_PP(args[i]), p-h, (void**)data) == SUCCESS 
+   if (zend_hash_index_find(Z_ARRVAL_PP(args[i]), 
p-h, (void**)data) == SUCCESS 
(!diff_data_compare_func ||

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/standard/tests/array bug43495.phpt ZendEngine2/tests bug41919.phpt

2008-05-29 Thread Matt Wilmas
mattwil Thu May 29 07:32:03 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/ZendEngine2/tests  bug41919.phpt 
/php-src/ext/standard/tests/array   bug43495.phpt 
  Log:
  Fixed tests on Windows
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug41919.phpt?r1=1.1.2.3.2.2r2=1.1.2.3.2.3diff_format=u
Index: ZendEngine2/tests/bug41919.phpt
diff -u ZendEngine2/tests/bug41919.phpt:1.1.2.3.2.2 
ZendEngine2/tests/bug41919.phpt:1.1.2.3.2.3
--- ZendEngine2/tests/bug41919.phpt:1.1.2.3.2.2 Thu Jan 24 08:51:38 2008
+++ ZendEngine2/tests/bug41919.phpt Thu May 29 07:32:03 2008
@@ -8,4 +8,4 @@
 echo ok\n;
 ?
 --EXPECTF--
-Fatal error: Cannot use string offset as an object in %s/bug41919.php on line 
%d
+Fatal error: Cannot use string offset as an object in %sbug41919.php on line %d
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug43495.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/standard/tests/array/bug43495.phpt
diff -u php-src/ext/standard/tests/array/bug43495.phpt:1.1.2.2 
php-src/ext/standard/tests/array/bug43495.phpt:1.1.2.3
--- php-src/ext/standard/tests/array/bug43495.phpt:1.1.2.2  Thu Dec 13 
07:57:39 2007
+++ php-src/ext/standard/tests/array/bug43495.phpt  Thu May 29 07:32:03 2008
@@ -17,5 +17,5 @@
 echo Done.\n;
 ?
 --EXPECTF--
-Warning: array_merge_recursive(): recursion detected in %s/bug43495.php on 
line %d
+Warning: array_merge_recursive(): recursion detected in %sbug43495.php on line 
%d
 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) /ext/standard/tests/array bug43495.phpt ZendEngine2/tests bug41919.phpt

2008-05-29 Thread Matt Wilmas
mattwil Thu May 29 07:33:03 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/ZendEngine2/tests  bug41919.phpt 
/php-src/ext/standard/tests/array   bug43495.phpt 
  Log:
  Fixed tests on Windows
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug41919.phpt?r1=1.1.2.4r2=1.1.2.5diff_format=u
Index: ZendEngine2/tests/bug41919.phpt
diff -u ZendEngine2/tests/bug41919.phpt:1.1.2.4 
ZendEngine2/tests/bug41919.phpt:1.1.2.5
--- ZendEngine2/tests/bug41919.phpt:1.1.2.4 Thu Jan 24 08:51:04 2008
+++ ZendEngine2/tests/bug41919.phpt Thu May 29 07:33:03 2008
@@ -8,4 +8,4 @@
 echo ok\n;
 ?
 --EXPECTF--
-Fatal error: Cannot use string offset as an object in %s/bug41919.php on line 
%d
+Fatal error: Cannot use string offset as an object in %sbug41919.php on line %d
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug43495.phpt?r1=1.2.2.3r2=1.2.2.4diff_format=u
Index: php-src/ext/standard/tests/array/bug43495.phpt
diff -u php-src/ext/standard/tests/array/bug43495.phpt:1.2.2.3 
php-src/ext/standard/tests/array/bug43495.phpt:1.2.2.4
--- php-src/ext/standard/tests/array/bug43495.phpt:1.2.2.3  Thu Dec 13 
07:57:24 2007
+++ php-src/ext/standard/tests/array/bug43495.phpt  Thu May 29 07:33:03 2008
@@ -17,5 +17,5 @@
 echo Done.\n;
 ?
 --EXPECTF--
-Warning: array_merge_recursive(): recursion detected in %s/bug43495.php on 
line %d
+Warning: array_merge_recursive(): recursion detected in %sbug43495.php on line 
%d
 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_3) /ext/standard dns.c

2008-05-23 Thread Matt Wilmas
mattwil Fri May 23 09:40:44 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   dns.c 
  Log:
  MFH: Fixed Windows build now that HAVE_INET_PTON is defined
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.70.2.7.2.5.2.5r2=1.70.2.7.2.5.2.6diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.70.2.7.2.5.2.5 
php-src/ext/standard/dns.c:1.70.2.7.2.5.2.6
--- php-src/ext/standard/dns.c:1.70.2.7.2.5.2.5 Mon Apr 14 16:50:11 2008
+++ php-src/ext/standard/dns.c  Fri May 23 09:40:44 2008
@@ -18,10 +18,11 @@
+--+
  */
 
-/* $Id: dns.c,v 1.70.2.7.2.5.2.5 2008/04/14 16:50:11 colder Exp $ */
+/* $Id: dns.c,v 1.70.2.7.2.5.2.6 2008/05/23 09:40:44 mattwil Exp $ */
 
 /* {{{ includes */
 #include php.h
+#include php_network.h
 
 #if HAVE_SYS_SOCKET_H
 #include sys/socket.h



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



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

2008-05-23 Thread Matt Wilmas
mattwil Fri May 23 09:40:19 2008 UTC

  Modified files:  
/php-src/ext/standard   dns.c 
  Log:
  Fixed Windows build now that HAVE_INET_PTON is defined
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dns.c?r1=1.92r2=1.93diff_format=u
Index: php-src/ext/standard/dns.c
diff -u php-src/ext/standard/dns.c:1.92 php-src/ext/standard/dns.c:1.93
--- php-src/ext/standard/dns.c:1.92 Mon Apr 14 16:49:30 2008
+++ php-src/ext/standard/dns.c  Fri May 23 09:40:19 2008
@@ -18,10 +18,11 @@
+--+
  */
 
-/* $Id: dns.c,v 1.92 2008/04/14 16:49:30 colder Exp $ */
+/* $Id: dns.c,v 1.93 2008/05/23 09:40:19 mattwil Exp $ */
 
 /* {{{ includes */
 #include php.h
+#include php_network.h
 
 #if HAVE_SYS_SOCKET_H
 #include sys/socket.h



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



[PHP-CVS] cvs: php-src /win32/build template.rc

2008-05-14 Thread Matt Wilmas
mattwil Wed May 14 11:18:08 2008 UTC

  Modified files:  
/php-src/win32/buildtemplate.rc 
  Log:
  MFB: Steph's changes; to fix build failure after confutils.js changes 
(PRODUCT_NAME being undefined)
  
http://cvs.php.net/viewvc.cgi/php-src/win32/build/template.rc?r1=1.10r2=1.11diff_format=u
Index: php-src/win32/build/template.rc
diff -u php-src/win32/build/template.rc:1.10 
php-src/win32/build/template.rc:1.11
--- php-src/win32/build/template.rc:1.10Mon Jan 29 04:40:46 2007
+++ php-src/win32/build/template.rc Wed May 14 11:18:08 2008
@@ -1,5 +1,5 @@
 /* This is a template RC file.
- * $Id: template.rc,v 1.10 2007/01/29 04:40:46 iliaa Exp $
+ * $Id: template.rc,v 1.11 2008/05/14 11:18:08 mattwil Exp $
  * Do not edit with MSVC */
 #ifdef APSTUDIO_INVOKED
 # error dont edit with MSVC
@@ -19,18 +19,32 @@
 0 ICON win32\build\php.ico
 #endif
 
-#define XSTRVER4(maj, min, rel, build) #maj . #min . #rel . #build
-#define XSTRVER3(maj, min, rel) #maj . #min . #rel
-#define STRVER4(maj, min, rel, build) XSTRVER4(maj, min, rel, build)
-#define STRVER3(maj, min, rel) XSTRVER3(maj, min, rel)
+#ifndef INTERNAL_NAME /* e.g. 'PHAR extension', 'CGI SAPI' */
+# ifdef FILE_DESCRIPTION
+#define INTERNAL_NAME FILE_DESCRIPTION /* e.g. 'PHP Script Interpreter', 'GD 
imaging' */
+# else
+#define INTERNAL_NAME FILE_NAME /* e.g. 'php5ts.dll', 'php_bz2.dll' */
+# endif
+#endif
+
+#ifndef URL
+#define URL http://www.php.net;
+#endif
+
+#ifndef EXT_VERSION
+#define EXT_VERSION PHP_VERSION
+#endif
+
+#ifndef EXT_FILE_VERSION
+#define EXT_FILE_VERSION 
PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION
+#endif
 
-//Version
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 
PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,PHP_RELEASE_VERSION
- PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION,0
+ FILEVERSION EXT_FILE_VERSION
+ PRODUCTVERSION PHP_MAJOR_VERSION,PHP_MINOR_VERSION,PHP_RELEASE_VERSION
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
- FILEFLAGS VS_FF_DEBUG
+ FILEFLAGS (VS_FF_DEBUG|VS_FF_SPECIALBUILD)
 #else
  FILEFLAGS 0x0L
 #endif
@@ -42,19 +56,24 @@
 BEGIN
 BLOCK 040904b0
 BEGIN
-VALUE Comments, THANKS_GUYS \0
-VALUE CompanyName, The PHP Group\0
-VALUE FileDescription, FILE_DESCRIPTION \0
-VALUE FileVersion, STRVER4(PHP_MAJOR_VERSION, PHP_MINOR_VERSION, 
PHP_RELEASE_VERSION, PHP_RELEASE_VERSION)
-VALUE InternalName, FILE_NAME \0
-VALUE LegalCopyright, Copyright © 1997-2007 The PHP Group\0
-VALUE LegalTrademarks, PHP\0
-VALUE OriginalFilename, FILE_NAME \0
-VALUE PrivateBuild, \0
-VALUE ProductName, PRODUCT_NAME \0
-VALUE ProductVersion, STRVER3(PHP_MAJOR_VERSION, 
PHP_MINOR_VERSION, PHP_RELEASE_VERSION)
-VALUE SpecialBuild, PHP_EXTRA_VERSION \0
-   VALUE URL, http://www.php.net;
+VALUE Comments, THANKS_GUYS
+VALUE CompanyName, The PHP Group
+#ifdef _DEBUG
+VALUE FileDescription, FILE_DESCRIPTION  (DEBUG)
+#else
+VALUE FileDescription, FILE_DESCRIPTION
+#endif
+VALUE FileVersion, EXT_VERSION
+VALUE InternalName, INTERNAL_NAME
+VALUE LegalCopyright, Copyright © 1997-2008 The PHP Group
+VALUE LegalTrademarks, PHP
+VALUE OriginalFilename, FILE_NAME
+VALUE ProductName, PHP
+VALUE ProductVersion, PHP_VERSION
+#ifdef _DEBUG
+VALUE SpecialBuild, Debug build
+#endif
+VALUE URL, URL
 END
 END
 BLOCK VarFileInfo
@@ -66,4 +85,3 @@
 #ifdef MC_INCLUDE
 #include MC_INCLUDE
 #endif
-



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



[PHP-CVS] cvs: php-src /win32/build buildconf.js

2008-05-14 Thread Matt Wilmas
mattwil Wed May 14 11:32:28 2008 UTC

  Modified files:  
/php-src/win32/buildbuildconf.js 
  Log:
  MFB: The Steph special :-) to allow plain 'configure' to be used
  
http://cvs.php.net/viewvc.cgi/php-src/win32/build/buildconf.js?r1=1.16r2=1.17diff_format=u
Index: php-src/win32/build/buildconf.js
diff -u php-src/win32/build/buildconf.js:1.16 
php-src/win32/build/buildconf.js:1.17
--- php-src/win32/build/buildconf.js:1.16   Mon Jan 29 04:40:46 2007
+++ php-src/win32/build/buildconf.jsWed May 14 11:32:28 2008
@@ -16,12 +16,13 @@
   +--+
 */
 
-/* $Id: buildconf.js,v 1.16 2007/01/29 04:40:46 iliaa Exp $ */
+/* $Id: buildconf.js,v 1.17 2008/05/14 11:32:28 mattwil Exp $ */
 // This generates a configure script for win32 build
 
 WScript.StdOut.WriteLine(Rebuilding configure.js);
 var FSO = WScript.CreateObject(Scripting.FileSystemObject);
 var C = FSO.CreateTextFile(configure.js, true);
+var B = FSO.CreateTextFile(configure.bat, true);
 
 var modules = ;
 var MODULES = WScript.CreateObject(Scripting.Dictionary);
@@ -259,5 +260,6 @@
 C.WriteBlankLines(1);
 C.Write(file_get_contents(win32/build/configure.tail));
 
-WScript.StdOut.WriteLine(Now run 'cscript /nologo configure.js --help');
-
+B.WriteLine(@echo off);
+B.WriteLine(cscript /nologo configure.js %*);
+WScript.StdOut.WriteLine(Now run 'configure --help');



-- 
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 stripslashes_variation2.phpt

2008-05-11 Thread Matt Wilmas
mattwil Mon May 12 05:06:53 2008 UTC

  Modified files:  
/php-src/ext/standard/tests/strings stripslashes_variation2.phpt 
  Log:
  Fixed test after fixing bug #44830
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/stripslashes_variation2.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/strings/stripslashes_variation2.phpt
diff -u php-src/ext/standard/tests/strings/stripslashes_variation2.phpt:1.2 
php-src/ext/standard/tests/strings/stripslashes_variation2.phpt:1.3
--- php-src/ext/standard/tests/strings/stripslashes_variation2.phpt:1.2 Fri Sep 
 7 14:03:33 2007
+++ php-src/ext/standard/tests/strings/stripslashes_variation2.phpt Mon May 
12 05:06:53 2008
@@ -229,9 +229,9 @@
 
 -- Iteration 21 --
 string(31) The string after addslashes is:
-string(2) \0
+string(2) \\
 string(33) The string after stripslashes is:
-string(1) +string(1) \
 
 -- Iteration 22 --
 string(31) The string after addslashes is:
@@ -457,9 +457,9 @@
 
 -- Iteration 21 --
 unicode(31) The string after addslashes is:
-unicode(2) \0
+unicode(2) \\
 unicode(33) The string after stripslashes is:
-unicode(1) +unicode(1) \
 
 -- Iteration 22 --
 unicode(31) The string after addslashes is:



-- 
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/strings stripslashes_variation2.phpt

2008-05-11 Thread Matt Wilmas
mattwil Mon May 12 05:08:49 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard/tests/strings stripslashes_variation2.phpt 
  Log:
  MFH: Fixed test after fixing bug #44830
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/stripslashes_variation2.phpt?r1=1.1.2.1r2=1.1.2.1.2.1diff_format=u
Index: php-src/ext/standard/tests/strings/stripslashes_variation2.phpt
diff -u php-src/ext/standard/tests/strings/stripslashes_variation2.phpt:1.1.2.1 
php-src/ext/standard/tests/strings/stripslashes_variation2.phpt:1.1.2.1.2.1
--- php-src/ext/standard/tests/strings/stripslashes_variation2.phpt:1.1.2.1 
Fri Sep  7 13:51:26 2007
+++ php-src/ext/standard/tests/strings/stripslashes_variation2.phpt Mon May 
12 05:08:49 2008
@@ -229,9 +229,9 @@
 
 -- Iteration 21 --
 string(31) The string after addslashes is:
-string(2) \0
+string(2) \\
 string(33) The string after stripslashes is:
-string(1) +string(1) \
 
 -- Iteration 22 --
 string(31) The string after addslashes is:



-- 
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 stripslashes_variation2.phpt

2008-05-11 Thread Matt Wilmas
mattwil Mon May 12 05:09:28 2008 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard/tests/strings stripslashes_variation2.phpt 
  Log:
  MFH: Fixed test after fixing bug #44830
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/stripslashes_variation2.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u
Index: php-src/ext/standard/tests/strings/stripslashes_variation2.phpt
diff -u php-src/ext/standard/tests/strings/stripslashes_variation2.phpt:1.1.2.1 
php-src/ext/standard/tests/strings/stripslashes_variation2.phpt:1.1.2.2
--- php-src/ext/standard/tests/strings/stripslashes_variation2.phpt:1.1.2.1 
Fri Sep  7 13:51:26 2007
+++ php-src/ext/standard/tests/strings/stripslashes_variation2.phpt Mon May 
12 05:09:28 2008
@@ -229,9 +229,9 @@
 
 -- Iteration 21 --
 string(31) The string after addslashes is:
-string(2) \0
+string(2) \\
 string(33) The string after stripslashes is:
-string(1) +string(1) \
 
 -- Iteration 22 --
 string(31) The string after addslashes is:



-- 
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 math.c

2008-05-07 Thread Matt Wilmas
mattwil Thu May  8 04:23:26 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/standard   math.c 
  Log:
  Fix build
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/math.c?r1=1.131.2.2.2.6.2.7r2=1.131.2.2.2.6.2.8diff_format=u
Index: php-src/ext/standard/math.c
diff -u php-src/ext/standard/math.c:1.131.2.2.2.6.2.7 
php-src/ext/standard/math.c:1.131.2.2.2.6.2.8
--- php-src/ext/standard/math.c:1.131.2.2.2.6.2.7   Tue May  6 10:55:49 2008
+++ php-src/ext/standard/math.c Thu May  8 04:23:26 2008
@@ -19,7 +19,7 @@
+--+
 */
 
-/* $Id: math.c,v 1.131.2.2.2.6.2.7 2008/05/06 10:55:49 kalle Exp $ */
+/* $Id: math.c,v 1.131.2.2.2.6.2.8 2008/05/08 04:23:26 mattwil Exp $ */
 
 #include php.h
 #include php_math.h
@@ -354,7 +354,7 @@
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, d, num) == 
FAILURE) {
return;
}
-   RETURN_DOUBLE(asinh(num));
+   RETURN_DOUBLE(php_asinh(num));
 }
 /* }}} */
 



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



[PHP-CVS] cvs: php-src /win32/build Makefile

2008-05-07 Thread Matt Wilmas
mattwil Thu May  8 04:52:30 2008 UTC

  Modified files:  
/php-src/win32/buildMakefile 
  Log:
  Remove old references to flex.skl
  
http://cvs.php.net/viewvc.cgi/php-src/win32/build/Makefile?r1=1.45r2=1.46diff_format=u
Index: php-src/win32/build/Makefile
diff -u php-src/win32/build/Makefile:1.45 php-src/win32/build/Makefile:1.46
--- php-src/win32/build/Makefile:1.45   Wed Mar 26 14:46:17 2008
+++ php-src/win32/build/MakefileThu May  8 04:52:30 2008
@@ -14,7 +14,7 @@
 #  | Author: Wez Furlong [EMAIL PROTECTED]   |
 #  +--+
 #
-# $Id: Makefile,v 1.45 2008/03/26 14:46:17 scottmac Exp $
+# $Id: Makefile,v 1.46 2008/05/08 04:52:30 mattwil Exp $
 # This is the makefile template for the win32 build
 
 CC=$(CL)
@@ -50,10 +50,10 @@
$(BISON) --output=Zend/zend_language_parser.c -v -d -p zend 
Zend/zend_language_parser.y
 
 !if $(RE2C) != 
-Zend\zend_ini_scanner.c: Zend\flex.skl Zend\zend_ini_scanner.l
+Zend\zend_ini_scanner.c: Zend\zend_ini_scanner.l
$(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt 
Zend/zend_ini_scanner_defs.h -oZend/zend_ini_scanner.c Zend/zend_ini_scanner.l
 
-Zend\zend_language_scanner.c: Zend\flex.skl Zend\zend_language_scanner.l
+Zend\zend_language_scanner.c: Zend\zend_language_scanner.l
$(RE2C) $(RE2C_FLAGS) --case-inverted -cbdFt 
Zend/zend_language_scanner_defs.h -oZend/zend_language_scanner.c 
Zend/zend_language_scanner.l
 !endif
 



-- 
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) / NEWS /ext/wddx wddx.c /ext/wddx/tests bug41527.phpt

2007-06-12 Thread Matt Wilmas
Hi Ilia,

Could you, or anyone, just put Matt instead of the e-mail addy in the NEWS
files? :-)


Thanks,
Matt

- Original Message -
From: Ilia Alshanetsky
Sent: Monday, June 11, 2007

 iliaa Mon Jun 11 15:08:43 2007 UTC

   Added files: (Branch: PHP_5_2)
 /php-src/ext/wddx/tests bug41527.phpt

   Modified files:
 /php-src NEWS
 /php-src/ext/wddx wddx.c
   Log:

   Fixed bug #41527 (WDDX deserialize numeric string array key).


http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.773r2=1.2027.2.547.2.774diff_format=u
[...]
 +- Fixed bug #41527 (WDDX deserialize numeric string array key).
(php_lists
 +  at realplain dot com, Ilia)

-- 
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) / NEWS /ext/wddx wddx.c /ext/wddx/tests bug41283.phpt

2007-05-08 Thread Matt Wilmas
Hi Ilia, all,

I've attached patches for what I think is a better fix here, and it
simplifies the code.  Looking at the CVS log, the is_numeric_string() usage
was added in version 1.120 to fix the first numeric key bug.  The simple,
better thing would've been to just change zend_hash... to zend_symtable...,
as I've done now.  Ilia, this is basically the same fix as Bug #38464 for
array_count_values().

Again, the symtable function will handle numeric string keys as elsewhere
in PHP.  The only thing that changes from the current code is that strings
with leading whitespace, + sign, or 0s won't be considered numeric again
(e.g. back to behavior before the symtable functions were created), which
should be correct if you don't want more future bug reports. ;-)


Matt


- Original Message -
From: Ilia Alshanetsky
Sent: Saturday, May 05, 2007

 iliaa Sat May  5 15:14:56 2007 UTC

   Added files: (Branch: PHP_5_2)
 /php-src/ext/wddx/tests bug41283.phpt

   Modified files:
 /php-src NEWS
 /php-src/ext/wddx wddx.c
   Log:

   Fixed bug #41283 (Bug with serializing array key that are doubles or
   floats).


http://cvs.php.net/viewvc.cgi/php-src/ext/wddx/wddx.c?r1=1.119.2.10.2.15r2=1.119.2.10.2.16diff_format=u
 Index: php-src/ext/wddx/wddx.c
 diff -u php-src/ext/wddx/wddx.c:1.119.2.10.2.15
php-src/ext/wddx/wddx.c:1.119.2.10.2.16
 --- php-src/ext/wddx/wddx.c:1.119.2.10.2.15 Sun Mar  4 04:38:43 2007
 +++ php-src/ext/wddx/wddx.c Sat May  5 15:14:56 2007
 @@ -16,7 +16,7 @@

+--+
   */

 -/* $Id: wddx.c,v 1.119.2.10.2.15 2007/03/04 04:38:43 stas Exp $ */
 +/* $Id: wddx.c,v 1.119.2.10.2.16 2007/05/05 15:14:56 iliaa Exp $ */

  #ifdef HAVE_CONFIG_H
  #include config.h
 @@ -984,6 +984,9 @@
   goto bigint;
   }
   l = (long) d;
 + if (l != d) {
 + goto bigint;
 + }
   case IS_LONG:
   zend_hash_index_update(target_hash, l, ent1-data, sizeof(zval *),
NULL);
   break;

Index: ext/wddx/wddx.c
===
RCS file: /repository/php-src/ext/wddx/wddx.c,v
retrieving revision 1.144
diff -u -r1.144 wddx.c
--- ext/wddx/wddx.c 24 Feb 2007 16:25:55 -  1.144
+++ ext/wddx/wddx.c 8 May 2007 09:07:59 -
@@ -975,22 +975,7 @@
add_property_zval(ent2-data, 
ent1-varname, ent1-data);
EG(scope) = old_scope;
} else {
-   long l;  
-   double d;
-   
-   switch 
(is_numeric_string(ent1-varname, strlen(ent1-varname), l, d, 0)) {
-   case IS_DOUBLE:
-   if (d  
INT_MAX) {
-   goto 
bigint;
-   }
-   l = (long) d;
-   case IS_LONG:
-   
zend_hash_index_update(target_hash, l, ent1-data, sizeof(zval *), NULL);
-   break;
-   default:
-bigint:
-   
zend_hash_update(target_hash,ent1-varname, strlen(ent1-varname)+1, 
ent1-data, sizeof(zval *), NULL);
-   }
+   
zend_symtable_update(target_hash, ent1-varname, strlen(ent1-varname)+1, 
ent1-data, sizeof(zval *), NULL);
}
efree(ent1-varname);
} else  {
Index: ext/wddx/wddx.c
===
RCS file: /repository/php-src/ext/wddx/wddx.c,v
retrieving revision 1.119.2.10.2.16
diff -u -r1.119.2.10.2.16 wddx.c
--- ext/wddx/wddx.c 5 May 2007 15:14:56 -   1.119.2.10.2.16
+++ ext/wddx/wddx.c 8 May 2007 09:08:34 -
@@ -974,26 +974,7 @@
add_property_zval(ent2-data, 
ent1-varname, ent1-data);
EG(scope) = old_scope;
} else {
-   long l;
-   double d;
-   int varname_len = 
strlen(ent1-varname);
-   
-   switch 
(is_numeric_string(ent1-varname, varname_len, l, d, 0)) {
-   

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

2007-01-16 Thread Matt Wilmas
Hi Ilia,

- Original Message -
From: Ilia Alshanetsky
Sent: Saturday, January 13, 2007

 iliaa Sat Jan 13 16:32:29 2007 UTC
 
   Modified files:  
 /php-src/ext/standard formatted_print.c 
   Log:
   
   MFB: Improve validation of argnum, width and precision.
   [...]
 - php_error_docref(NULL TSRMLS_CC, E_WARNING, Zero is not a valid argument 
 number);
 + php_error_docref(NULL TSRMLS_CC, E_WARNING, Argument number must be 
 greater then zero.);
   return NULL;
   }
  
 + php_error_docref(NULL TSRMLS_CC, E_WARNING, Width must be greater then 
 zero and less then %d., INT_MAX);
 + return NULL;
 + }

 + php_error_docref(NULL TSRMLS_CC, E_WARNING, Precision must be greater then 
 zero and less then %d., INT_MAX);
 + return NULL;
 + }


Just a grammar nit-pick, but in those new error messages, then should be
than. :-)  Also, just noticed the period at the end of the messages, which
the vast majority of messages elsewhere don't have, so seems like they
should be removed.  (I sent a patch a few months ago to remove trailing
periods in the few errors that had one, and Hannes just applied it to HEAD;
although a few others were added back since then...)  IMO, those periods
make the full generated warning line look weird, which was also mentioned in
Bug #39112.

If you want/need patches to save time, let me know...


Matt

-- 
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/soap php_sdl.c

2006-12-19 Thread Matt Wilmas
Oops, forgot to attach the patches!

- Original Message -
From: Matt Wilmas
Sent: Tuesday, December 19, 2006

 Hi Ilia,

 A little late, but I made a patch for HEAD since this wasn't applied
there.
 In the process, I noticed that i has the value of
zend_hash_num_elements()
 so the second call to it isn't needed.  (Indentation was also off on those
2
 lines...)


 Matt
Index: ext/soap/php_sdl.c
===
RCS file: /repository/php-src/ext/soap/php_sdl.c,v
retrieving revision 1.105
diff -u -r1.105 php_sdl.c
--- ext/soap/php_sdl.c  20 Sep 2006 13:43:04 -  1.105
+++ ext/soap/php_sdl.c  20 Dec 2006 03:48:01 -
@@ -1862,8 +1862,8 @@
if (i  0) {
sdlTypePtr *tmp;
 
- tmp_elements = emalloc(sizeof(HashTable));
- zend_hash_init(tmp_elements, 0, NULL, NULL, 0);
+   tmp_elements = emalloc(sizeof(HashTable));
+   zend_hash_init(tmp_elements, i, NULL, NULL, 0);
 
zend_hash_internal_pointer_reset(type-elements);
while (zend_hash_get_current_data(type-elements, (void**)tmp) 
== SUCCESS) {
Index: ext/soap/php_sdl.c
===
RCS file: /repository/php-src/ext/soap/php_sdl.c,v
retrieving revision 1.88.2.12.2.4
diff -u -r1.88.2.12.2.4 php_sdl.c
--- ext/soap/php_sdl.c  30 Nov 2006 23:51:24 -  1.88.2.12.2.4
+++ ext/soap/php_sdl.c  20 Dec 2006 03:49:58 -
@@ -1862,8 +1862,8 @@
if (i  0) {
sdlTypePtr *tmp;
 
- tmp_elements = emalloc(sizeof(HashTable));
- zend_hash_init(tmp_elements, zend_hash_num_elements(type-elements), 
NULL, NULL, 0);
+   tmp_elements = emalloc(sizeof(HashTable));
+   zend_hash_init(tmp_elements, i, NULL, NULL, 0);
 
zend_hash_internal_pointer_reset(type-elements);
while (zend_hash_get_current_data(type-elements, (void**)tmp) 
== SUCCESS) {

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

Re: [PHP-CVS] cvs: php-src /ext/standard formatted_print.c /ext/standard/tests/serialize 003.phpt /ext/standard/tests/strings sprintf_f.phpt /main snprintf.c snprintf.h spprintf.c ZendEngine2 zend

2006-12-06 Thread Matt Wilmas
Hi Antony,

The changes to formatted_print.c caught my eye because I was going to
inquire about/resubmit a patch from August to add new features the the
*printf() functions... :-)  I see you've added g/G (and E).  In
appenddouble, however, I noticed that the F specifier is missing.  Nothing
to me personally, just wondering about BC for users.  I haven't tried
anything yet, so maybe locale decimal point/not is handled differently now.
Regardless, F will be ignored, though it's still present in
php_formatted_print().

If you want to see the patch I made in the summer, see
http://news.php.net/php.internals/25276 and
http://realplain.com/php/printf_additions.diff

I never got around to creating tests for the new features, and also thought
I should [maybe] make some small changes in how I did the code.  Of course
now I'll need to reimplement the appenddouble changes anyway, to accommodate
the new code.  I guess I'll go ahead and redo it soon.  Any comments about
the additions/patch from you or anyone else?  Marcus said they sounded good
before I made the patch, but I didn't hear any more. :-/


Thanks,
Matt


- Original Message -
From: Antony Dovgal
Sent: Wednesday, December 06, 2006

 tony2001 Wed Dec  6 09:50:28 2006 UTC

   Modified files:
 /ZendEngine2 zend.c zend_strtod.c zend_strtod.h
 /php-src/ext/standard formatted_print.c
 /php-src/ext/standard/tests/serialize 003.phpt
 /php-src/ext/standard/tests/strings sprintf_f.phpt
 /php-src/main snprintf.c snprintf.h spprintf.c
   Log:
   use BSD licensed implementation of double-to-string utilities instead of
LGPL one
   this patch also fixes thread safety issues in zend_strtod()


-- 
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) / NEWS /ext/standard array.c

2006-11-13 Thread Matt Wilmas
Hi Ilia,

Oh, sorry, didn't know it was a time issue. :-)  I thought both branches
were mostly always updated together to keep things synced, etc.  In that
case, if it saves you any time, I've attached the patch for HEAD.


- Original Message -
From: Ilia Alshanetsky
Sent: Monday, November 13, 2006

Matt,

I did a cursory check through ext/ and this seems like the only place
the optimization trick can be applied. I will look into writing a
patch for HEAD when I have a bit more time.


On 12-Nov-06, at 6:20 PM, Matt Wilmas wrote:

 Hi Ilia,

 Ah, I had wondered what other places could be changed to use the
 _quick
 functions (but didn't really check). :-)  Anyway, will this be
 applied to
 HEAD also?


 Matt


 - Original Message -
 From: Ilia Alshanetsky
 Sent: Sunday, November 12, 2006

 iliaa Sun Nov 12 17:13:23 2006 UTC

   Modified files:  (Branch: PHP_5_2)
 /php-src NEWS
 /php-src/ext/standard array.c
   Log:
   Optimized array functions utilizing php_splice().

Index: ext/standard/array.c
===
RCS file: /repository/php-src/ext/standard/array.c,v
retrieving revision 1.390
diff -u -r1.390 array.c
--- ext/standard/array.c12 Nov 2006 01:11:58 -  1.390
+++ ext/standard/array.c13 Nov 2006 15:04:19 -
@@ -1977,7 +1977,7 @@
if (p-nKeyLength == 0) {
zend_hash_next_index_insert(out_hash, entry, 
sizeof(zval *), NULL);
} else {
-   zend_u_hash_update(out_hash, p-key.type, 
ZSTR(p-key.arKey.s), p-nKeyLength, entry, sizeof(zval *), NULL);
+   zend_u_hash_quick_update(out_hash, p-key.type, 
ZSTR(p-key.arKey.s), p-nKeyLength, p-h, entry, sizeof(zval *), NULL);
}
}

@@ -1989,7 +1989,7 @@
if (p-nKeyLength == 0) {
zend_hash_next_index_insert(*removed, entry, 
sizeof(zval *), NULL);
} else {
-   zend_u_hash_update(*removed, p-key.type, 
ZSTR(p-key.arKey.s), p-nKeyLength, entry, sizeof(zval *), NULL);
+   zend_u_hash_quick_update(*removed, p-key.type, 
ZSTR(p-key.arKey.s), p-nKeyLength, p-h, entry, sizeof(zval *), NULL);
}
}
} else /* otherwise just skip those entries */
@@ -2000,17 +2000,7 @@
/* ..for each one, create a new zval, copy entry into it and 
copy it into the output hash */
for (i=0; ilist_count; i++) {
entry = *list[i];
-   if (entry-refcount=1000) {
-   zval *tmp = (zval *) emalloc(sizeof(zval));
-
-   *tmp = *entry;
-   zval_copy_ctor(tmp);
-   tmp-refcount = 1;
-   tmp-is_ref = 0;
-   entry = tmp;
-   } else {
-   entry-refcount++;
-   }
+   entry-refcount++;
zend_hash_next_index_insert(out_hash, entry, 
sizeof(zval *), NULL);
}
}
@@ -2022,7 +2012,7 @@
if (p-nKeyLength == 0) {
zend_hash_next_index_insert(out_hash, entry, 
sizeof(zval *), NULL);
} else {
-   zend_u_hash_update(out_hash, p-key.type, 
ZSTR(p-key.arKey.s), p-nKeyLength, entry, sizeof(zval *), NULL);
+   zend_u_hash_quick_update(out_hash, p-key.type, 
ZSTR(p-key.arKey.s), p-nKeyLength, p-h, entry, sizeof(zval *), NULL);
}
}

-- 
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) / NEWS /ext/standard array.c

2006-11-12 Thread Matt Wilmas
Hi Ilia,

Ah, I had wondered what other places could be changed to use the _quick
functions (but didn't really check). :-)  Anyway, will this be applied to
HEAD also?


Matt


- Original Message -
From: Ilia Alshanetsky
Sent: Sunday, November 12, 2006

 iliaa Sun Nov 12 17:13:23 2006 UTC

   Modified files:  (Branch: PHP_5_2)
 /php-src NEWS
 /php-src/ext/standard array.c
   Log:
   Optimized array functions utilizing php_splice().



http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.357r2=1.2027.2.547.2.358diff_format=u
 Index: php-src/NEWS
 diff -u php-src/NEWS:1.2027.2.547.2.357 php-src/NEWS:1.2027.2.547.2.358
 --- php-src/NEWS:1.2027.2.547.2.357 Sun Nov 12 01:14:39 2006
 +++ php-src/NEWS Sun Nov 12 17:13:22 2006
 @@ -15,6 +15,7 @@
  - Streams optimization (Dmitry)
. removed unnecessary ftell() calls (one call for each included PHP
file)
. disabled calls to read() after EOF
 +- Optimized array functions utilizing php_splice(). (Ilia)
  - VCWD_REALPATH() is improved to use realpath cache without VIRTUAL_DIR.
(Dmitry)
  - ext/bcmath intialization code is moved from request startup to module

http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.15r2=1.308.2.21.2.16diff_format=u
 Index: php-src/ext/standard/array.c
 diff -u php-src/ext/standard/array.c:1.308.2.21.2.15
php-src/ext/standard/array.c:1.308.2.21.2.16
 --- php-src/ext/standard/array.c:1.308.2.21.2.15 Sun Nov 12 01:14:39 2006
 +++ php-src/ext/standard/array.c Sun Nov 12 17:13:22 2006
 @@ -21,7 +21,7 @@

+--+
  */

 -/* $Id: array.c,v 1.308.2.21.2.15 2006/11/12 01:14:39 bjori Exp $ */
 +/* $Id: array.c,v 1.308.2.21.2.16 2006/11/12 17:13:22 iliaa Exp $ */

  #include php.h
  #include php_ini.h
 @@ -1874,7 +1874,7 @@

   /* Update output hash depending on key type */
   if (p-nKeyLength)
 - zend_hash_update(out_hash, p-arKey, p-nKeyLength, entry, sizeof(zval
*), NULL);
 + zend_hash_quick_update(out_hash, p-arKey, p-nKeyLength, p-h, entry,
sizeof(zval *), NULL);
   else
   zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL);
   }
 @@ -1885,7 +1885,7 @@
   entry = *((zval **)p-pData);
   entry-refcount++;
   if (p-nKeyLength)
 - zend_hash_update(*removed, p-arKey, p-nKeyLength, entry, sizeof(zval
*), NULL);
 + zend_hash_quick_update(*removed, p-arKey, p-nKeyLength, p-h, entry,
sizeof(zval *), NULL);
   else
   zend_hash_next_index_insert(*removed, entry, sizeof(zval *), NULL);
   }
 @@ -1897,17 +1897,7 @@
   /* ..for each one, create a new zval, copy entry into it and copy it
into the output hash */
   for (i=0; ilist_count; i++) {
   entry = *list[i];
 - if (entry-refcount=1000) {
 - zval *tmp = (zval *) emalloc(sizeof(zval));
 -
 - *tmp = *entry;
 - zval_copy_ctor(tmp);
 - tmp-refcount = 1;
 - tmp-is_ref = 0;
 - entry = tmp;
 - } else {
 - entry-refcount++;
 - }
 + entry-refcount++;
   zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL);
   }
   }
 @@ -1917,7 +1907,7 @@
   entry = *((zval **)p-pData);
   entry-refcount++;
   if (p-nKeyLength)
 - zend_hash_update(out_hash, p-arKey, p-nKeyLength, entry, sizeof(zval
*), NULL);
 + zend_hash_quick_update(out_hash, p-arKey, p-nKeyLength, p-h, entry,
sizeof(zval *), NULL);
   else
   zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL);
   }
 @@ -2212,7 +2202,7 @@
   /* Get the arguments and do error-checking */
   argc = ZEND_NUM_ARGS();
   if (argc  2 || argc  4 || zend_get_parameters_ex(argc, input,
offset, length, z_preserve_keys)) {
 - WRONG_PARAM_COUNT;
 + WRONG_PARA¬M_COUNT;
   }

   if (Z_TYPE_PP(input) != IS_ARRAY) {

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