[PHP-CVS-DAILY] cvs: php-src / ChangeLog

2008-06-07 Thread changelog
changelog   Sun Jun  8 01:31:56 2008 UTC

  Modified files:  
/php-srcChangeLog 
  Log:
  ChangeLog update
  
http://cvs.php.net/viewvc.cgi/php-src/ChangeLog?r1=1.3070r2=1.3071diff_format=u
Index: php-src/ChangeLog
diff -u php-src/ChangeLog:1.3070 php-src/ChangeLog:1.3071
--- php-src/ChangeLog:1.3070Sat Jun  7 01:31:42 2008
+++ php-src/ChangeLog   Sun Jun  8 01:31:55 2008
@@ -1,3 +1,98 @@
+2008-06-07  Antony Dovgal  [EMAIL PROTECTED]
+
+* ext/date/php_date.c:
+  fix ZTS build
+
+* ext/spl/spl_fastarray.c
+  ext/spl/tests/fastarray_015.phpt
+  ext/spl/tests/fastarray_015.phpt:
+  more checks and tests
+
+2008-06-07  Henrique do Nascimento Angelo  [EMAIL PROTECTED]
+
+* ext/exif/tests/bug34704.phpt
+  ext/exif/tests/exif001.phpt
+  ext/exif/tests/exif004.phpt
+  ext/exif/tests/exif005.phpt:
+  Update exif tests to conform with the unicode functions
+
+* ext/exif/exif.c:
+  Add Unicode support
+
+* ext/date/tests/008.phpt
+  ext/date/tests/011.phpt
+  ext/date/tests/013.phpt
+  ext/date/tests/014.phpt
+  ext/date/tests/bug41523-64bit.phpt
+  ext/date/tests/bug41523.phpt
+  ext/date/tests/bug43808.phpt
+  ext/date/tests/date_parse_001.phpt:
+  Update tests to conform with the unicode functions
+
+* ext/date/php_date.c:
+  Add Unicode support and set as unicode compatible
+
+2008-06-07  Antony Dovgal  [EMAIL PROTECTED]
+
+* (PHP_5_3)
+  ext/spl/tests/fastarray_005.phpt
+  ext/spl/tests/fastarray_006.phpt
+  ext/spl/tests/fastarray_007.phpt
+  ext/spl/tests/fastarray_008.phpt
+  ext/spl/tests/fastarray_009.phpt
+  ext/spl/tests/fastarray_010.phpt
+  ext/spl/tests/fastarray_011.phpt
+  ext/spl/tests/fastarray_012.phpt
+  ext/spl/tests/fastarray_013.phpt
+  ext/spl/tests/fastarray_014.phpt:
+  add more tests (Felipe)
+
+* ext/spl/tests/fastarray_004.phpt
+  ext/spl/tests/fastarray_005.phpt
+  ext/spl/tests/fastarray_005.phpt
+  ext/spl/tests/fastarray_006.phpt
+  ext/spl/tests/fastarray_006.phpt
+  ext/spl/tests/fastarray_007.phpt
+  ext/spl/tests/fastarray_007.phpt
+  ext/spl/tests/fastarray_008.phpt
+  ext/spl/tests/fastarray_008.phpt
+  ext/spl/tests/fastarray_009.phpt
+  ext/spl/tests/fastarray_009.phpt
+  ext/spl/tests/fastarray_010.phpt
+  ext/spl/tests/fastarray_010.phpt
+  ext/spl/tests/fastarray_011.phpt
+  ext/spl/tests/fastarray_011.phpt
+  ext/spl/tests/fastarray_012.phpt
+  ext/spl/tests/fastarray_012.phpt
+  ext/spl/tests/fastarray_013.phpt
+  ext/spl/tests/fastarray_013.phpt
+  ext/spl/tests/fastarray_014.phpt
+  ext/spl/tests/fastarray_014.phpt:
+  more tests (by Felipe)
+
+* ext/spl/spl_fastarray.c:
+  fix several memleaks and invalid reads
+
+* ext/spl/tests/fastarray_004.phpt
+  ext/spl/tests/fastarray_004.phpt:
+  
+  file fastarray_004.phpt was initially added on branch PHP_5_3.
+
+* ext/spl/spl_fastarray.c:
+  disallow $a[] = value syntax
+
+* ext/spl/spl_fastarray.h:
+  update credits
+
+2008-06-07  Etienne Kneuss  [EMAIL PROTECTED]
+
+* (PHP_5_3)
+  ext/spl/spl_fastarray.c:
+  MFH: Fix segfault caused by get_current_data on an uninitialized element
+
+* ext/spl/spl_fastarray.c:
+  Fix segfault caused by get_current_data on an uninitialized element
+
 2008-06-06  Etienne Kneuss  [EMAIL PROTECTED]
 
 * ext/spl/config.m4




[PHP-CVS] cvs: php-src /ext/spl spl_fastarray.h

2008-06-07 Thread Antony Dovgal
tony2001Sat Jun  7 08:05:48 2008 UTC

  Modified files:  
/php-src/ext/splspl_fastarray.h 
  Log:
  update credits
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_fastarray.h?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/spl/spl_fastarray.h
diff -u php-src/ext/spl/spl_fastarray.h:1.1 php-src/ext/spl/spl_fastarray.h:1.2
--- php-src/ext/spl/spl_fastarray.h:1.1 Fri Jun  6 23:53:10 2008
+++ php-src/ext/spl/spl_fastarray.h Sat Jun  7 08:05:48 2008
@@ -13,10 +13,11 @@
   | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
   +--+
   | Author: Antony Dovgal [EMAIL PROTECTED]  |
+  | Etienne Kneuss [EMAIL PROTECTED]  |
   +--+
 */
 
-/* $Id: spl_fastarray.h,v 1.1 2008/06/06 23:53:10 colder Exp $ */
+/* $Id: spl_fastarray.h,v 1.2 2008/06/07 08:05:48 tony2001 Exp $ */
 
 #ifndef SPL_FASTARRAY_H
 #define SPL_FASTARRAY_H



-- 
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/spl spl_fastarray.h

2008-06-07 Thread Antony Dovgal
tony2001Sat Jun  7 08:05:55 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_fastarray.h 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_fastarray.h?r1=1.1.2.2r2=1.1.2.3diff_format=u
Index: php-src/ext/spl/spl_fastarray.h
diff -u php-src/ext/spl/spl_fastarray.h:1.1.2.2 
php-src/ext/spl/spl_fastarray.h:1.1.2.3
--- php-src/ext/spl/spl_fastarray.h:1.1.2.2 Fri Jun  6 23:53:43 2008
+++ php-src/ext/spl/spl_fastarray.h Sat Jun  7 08:05:55 2008
@@ -13,10 +13,11 @@
   | [EMAIL PROTECTED] so we can mail you a copy immediately.   |
   +--+
   | Author: Antony Dovgal [EMAIL PROTECTED]  |
+  | Etienne Kneuss [EMAIL PROTECTED]  |
   +--+
 */
 
-/* $Id: spl_fastarray.h,v 1.1.2.2 2008/06/06 23:53:43 colder Exp $ */
+/* $Id: spl_fastarray.h,v 1.1.2.3 2008/06/07 08:05:55 tony2001 Exp $ */
 
 #ifndef SPL_FASTARRAY_H
 #define SPL_FASTARRAY_H



-- 
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/spl spl_fastarray.c

2008-06-07 Thread Antony Dovgal
tony2001Sat Jun  7 12:47:05 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_fastarray.c 
  Log:
  MFH: disallow $a[] = value syntax
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_fastarray.c?r1=1.1.2.3r2=1.1.2.4diff_format=u
Index: php-src/ext/spl/spl_fastarray.c
diff -u php-src/ext/spl/spl_fastarray.c:1.1.2.3 
php-src/ext/spl/spl_fastarray.c:1.1.2.4
--- php-src/ext/spl/spl_fastarray.c:1.1.2.3 Sat Jun  7 01:46:44 2008
+++ php-src/ext/spl/spl_fastarray.c Sat Jun  7 12:47:04 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: spl_fastarray.c,v 1.1.2.3 2008/06/07 01:46:44 colder Exp $ */
+/* $Id: spl_fastarray.c,v 1.1.2.4 2008/06/07 12:47:04 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -321,6 +321,12 @@
 {
long index;
 
+   if (!offset) {
+   /* '$array[] = value' syntax is not supported */
+   zend_throw_exception(spl_ce_RuntimeException, Index invalid or 
out of range, 0 TSRMLS_CC);
+   return;
+   }
+
index = spl_offset_convert_to_long(offset TSRMLS_CC);
 
if (index  0 || index = intern-array-size) {



-- 
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/spl/tests fastarray_004.phpt

2008-06-07 Thread Antony Dovgal
tony2001Sat Jun  7 12:49:35 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests  fastarray_004.phpt 
  Log:
  add new test
  
  

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



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



[PHP-CVS] cvs: CVSROOT / avail

2008-06-07 Thread Johannes Schlüter
johannesSat Jun  7 13:08:21 2008 UTC

  Modified files:  
/CVSROOTavail 
  Log:
  phpdoc-de karma for thorstenr
  
http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1407r2=1.1408diff_format=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.1407 CVSROOT/avail:1.1408
--- CVSROOT/avail:1.1407Wed Jun  4 10:50:26 2008
+++ CVSROOT/avail   Sat Jun  7 13:08:20 2008
@@ -62,7 +62,7 @@
 
avail|noihex,mfalgas,ereza,ebi,ait,jabro,eduardcapell,oriolm,yagooar,jeprubio,marctm|phpdoc-ca
 avail|mkoula|phpdoc-cs
 avail|penguin,tkxs|phpdoc-da
-avail|kore|phpdoc-de
+avail|kore,thorstenr|phpdoc-de
 avail|ianasa,gustavo,soywiz,ladderalice,ideados,fcaroberga|phpdoc-es
 avail|parstic|phpdoc-fa
 avail|magidev|phpdoc-fr



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



[PHP-CVS] cvs: php-src /ext/spl spl_fastarray.c

2008-06-07 Thread Antony Dovgal
tony2001Sat Jun  7 14:08:59 2008 UTC

  Modified files:  
/php-src/ext/splspl_fastarray.c 
  Log:
  fix several memleaks and invalid reads
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_fastarray.c?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/spl/spl_fastarray.c
diff -u php-src/ext/spl/spl_fastarray.c:1.3 php-src/ext/spl/spl_fastarray.c:1.4
--- php-src/ext/spl/spl_fastarray.c:1.3 Sat Jun  7 12:46:54 2008
+++ php-src/ext/spl/spl_fastarray.c Sat Jun  7 14:08:59 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: spl_fastarray.c,v 1.3 2008/06/07 12:46:54 tony2001 Exp $ */
+/* $Id: spl_fastarray.c,v 1.4 2008/06/07 14:08:59 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -109,6 +109,7 @@
 
if (array-elements) {
efree(array-elements);
+   array-elements = NULL;
}
} else if (size  array-size) {
array-elements = erealloc(array-elements, sizeof(zval *) * 
size);
@@ -147,16 +148,18 @@
spl_fastarray_object *intern = (spl_fastarray_object *)object;
long i;
 
-   for (i = 0; i  intern-array-size; i++) {
-   if (intern-array-elements[i]) {
-   zval_ptr_dtor((intern-array-elements[i]));
+   if (intern-array) {
+   for (i = 0; i  intern-array-size; i++) {
+   if (intern-array-elements[i]) {
+   zval_ptr_dtor((intern-array-elements[i]));
+   }
}
-   }
 
-   if (intern-array-elements) {
-   efree(intern-array-elements);
+   if (intern-array-elements) {
+   efree(intern-array-elements);
+   }
+   efree(intern-array);
}
-   efree(intern-array);
 
zend_object_std_dtor(intern-std TSRMLS_CC);
zval_ptr_dtor(intern-retval);
@@ -280,13 +283,20 @@
 {
long index;
 
+   /* we have to return NULL on error here to avoid memleak because of 
+* ZE duplicating uninitialized_zval_ptr */
+   if (!offset) {
+   zend_throw_exception(spl_ce_RuntimeException, Index invalid or 
out of range, 0 TSRMLS_CC);
+   return NULL;
+   }
+
index = spl_offset_convert_to_long(offset TSRMLS_CC);

if (index  0 || index = intern-array-size) {
zend_throw_exception(spl_ce_RuntimeException, Index invalid or 
out of range, 0 TSRMLS_CC);
-   return EG(uninitialized_zval_ptr);
+   return NULL;
} else if(!intern-array-elements[index]) {
-   return EG(uninitialized_zval_ptr);
+   return NULL;
} else {
return intern-array-elements[index];
}
@@ -296,6 +306,7 @@
 static zval *spl_fastarray_object_read_dimension(zval *object, zval *offset, 
int type TSRMLS_DC) /* {{{ */
 {
spl_fastarray_object *intern;
+   zval **retval;
 
intern = (spl_fastarray_object *)zend_object_store_get_object(object 
TSRMLS_CC);
 
@@ -313,7 +324,11 @@
return EG(uninitialized_zval_ptr);
}
 
-   return *spl_fastarray_object_read_dimension_helper(intern, offset 
TSRMLS_CC);
+   retval = spl_fastarray_object_read_dimension_helper(intern, offset 
TSRMLS_CC);
+   if (retval) {
+   return *retval;
+   }
+   return NULL;
 }
 /* }}} */
 
@@ -573,7 +588,10 @@
intern= (spl_fastarray_object 
*)zend_object_store_get_object(getThis() TSRMLS_CC);
value_pp  = spl_fastarray_object_read_dimension_helper(intern, zindex 
TSRMLS_CC);
 
-   RETURN_ZVAL(*value_pp, 1, 0);
+   if (value_pp) {
+   RETURN_ZVAL(*value_pp, 1, 0);
+   }
+   RETURN_NULL();
 } /* }}} */
 
 /* {{{ proto void SplFastArray::offsetSet(mixed $index, mixed $newval) U
@@ -684,6 +702,10 @@
 
*data = spl_fastarray_object_read_dimension_helper(intern, zindex 
TSRMLS_CC);
 
+   if (*data == NULL) {
+   *data = EG(uninitialized_zval_ptr);
+   }
+
zval_ptr_dtor(zindex);
 }
 /* }}} */
@@ -784,7 +806,10 @@
 
zval_ptr_dtor(zindex);
 
-   RETURN_ZVAL(*value_pp, 1, 0);
+   if (value_pp) {
+   RETURN_ZVAL(*value_pp, 1, 0);
+   }
+   RETURN_NULL();
 }
 /* }}} */
 



-- 
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/spl spl_fastarray.c

2008-06-07 Thread Antony Dovgal
tony2001Sat Jun  7 14:09:06 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/ext/splspl_fastarray.c 
  Log:
  MFH
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_fastarray.c?r1=1.1.2.4r2=1.1.2.5diff_format=u
Index: php-src/ext/spl/spl_fastarray.c
diff -u php-src/ext/spl/spl_fastarray.c:1.1.2.4 
php-src/ext/spl/spl_fastarray.c:1.1.2.5
--- php-src/ext/spl/spl_fastarray.c:1.1.2.4 Sat Jun  7 12:47:04 2008
+++ php-src/ext/spl/spl_fastarray.c Sat Jun  7 14:09:06 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: spl_fastarray.c,v 1.1.2.4 2008/06/07 12:47:04 tony2001 Exp $ */
+/* $Id: spl_fastarray.c,v 1.1.2.5 2008/06/07 14:09:06 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -109,6 +109,7 @@
 
if (array-elements) {
efree(array-elements);
+   array-elements = NULL;
}
} else if (size  array-size) {
array-elements = erealloc(array-elements, sizeof(zval *) * 
size);
@@ -147,16 +148,18 @@
spl_fastarray_object *intern = (spl_fastarray_object *)object;
long i;
 
-   for (i = 0; i  intern-array-size; i++) {
-   if (intern-array-elements[i]) {
-   zval_ptr_dtor((intern-array-elements[i]));
+   if (intern-array) {
+   for (i = 0; i  intern-array-size; i++) {
+   if (intern-array-elements[i]) {
+   zval_ptr_dtor((intern-array-elements[i]));
+   }
}
-   }
 
-   if (intern-array-elements) {
-   efree(intern-array-elements);
+   if (intern-array-elements) {
+   efree(intern-array-elements);
+   }
+   efree(intern-array);
}
-   efree(intern-array);
 
zend_object_std_dtor(intern-std TSRMLS_CC);
zval_ptr_dtor(intern-retval);
@@ -280,13 +283,20 @@
 {
long index;
 
+   /* we have to return NULL on error here to avoid memleak because of 
+* ZE duplicating uninitialized_zval_ptr */
+   if (!offset) {
+   zend_throw_exception(spl_ce_RuntimeException, Index invalid or 
out of range, 0 TSRMLS_CC);
+   return NULL;
+   }
+
index = spl_offset_convert_to_long(offset TSRMLS_CC);

if (index  0 || index = intern-array-size) {
zend_throw_exception(spl_ce_RuntimeException, Index invalid or 
out of range, 0 TSRMLS_CC);
-   return EG(uninitialized_zval_ptr);
+   return NULL;
} else if(!intern-array-elements[index]) {
-   return EG(uninitialized_zval_ptr);
+   return NULL;
} else {
return intern-array-elements[index];
}
@@ -296,6 +306,7 @@
 static zval *spl_fastarray_object_read_dimension(zval *object, zval *offset, 
int type TSRMLS_DC) /* {{{ */
 {
spl_fastarray_object *intern;
+   zval **retval;
 
intern = (spl_fastarray_object *)zend_object_store_get_object(object 
TSRMLS_CC);
 
@@ -313,7 +324,11 @@
return EG(uninitialized_zval_ptr);
}
 
-   return *spl_fastarray_object_read_dimension_helper(intern, offset 
TSRMLS_CC);
+   retval = spl_fastarray_object_read_dimension_helper(intern, offset 
TSRMLS_CC);
+   if (retval) {
+   return *retval;
+   }
+   return NULL;
 }
 /* }}} */
 
@@ -573,7 +588,10 @@
intern= (spl_fastarray_object 
*)zend_object_store_get_object(getThis() TSRMLS_CC);
value_pp  = spl_fastarray_object_read_dimension_helper(intern, zindex 
TSRMLS_CC);
 
-   RETURN_ZVAL(*value_pp, 1, 0);
+   if (value_pp) {
+   RETURN_ZVAL(*value_pp, 1, 0);
+   }
+   RETURN_NULL();
 } /* }}} */
 
 /* {{{ proto void SplFastArray::offsetSet(mixed $index, mixed $newval) U
@@ -684,6 +702,10 @@
 
*data = spl_fastarray_object_read_dimension_helper(intern, zindex 
TSRMLS_CC);
 
+   if (*data == NULL) {
+   *data = EG(uninitialized_zval_ptr);
+   }
+
zval_ptr_dtor(zindex);
 }
 /* }}} */
@@ -784,7 +806,10 @@
 
zval_ptr_dtor(zindex);
 
-   RETURN_ZVAL(*value_pp, 1, 0);
+   if (value_pp) {
+   RETURN_ZVAL(*value_pp, 1, 0);
+   }
+   RETURN_NULL();
 }
 /* }}} */
 



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



[PHP-CVS] cvs: php-src /ext/spl/tests fastarray_004.phpt fastarray_005.phpt fastarray_006.phpt fastarray_007.phpt fastarray_008.phpt fastarray_009.phpt fastarray_010.phpt fastarray_011.phpt fastarray_

2008-06-07 Thread Antony Dovgal
tony2001Sat Jun  7 14:10:22 2008 UTC

  Added files: 
/php-src/ext/spl/tests  fastarray_005.phpt fastarray_006.phpt 
fastarray_007.phpt fastarray_008.phpt 
fastarray_009.phpt fastarray_010.phpt 
fastarray_011.phpt fastarray_012.phpt 
fastarray_013.phpt fastarray_014.phpt 

  Modified files:  
/php-src/ext/spl/tests  fastarray_004.phpt 
  Log:
  more tests (by Felipe)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_004.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/spl/tests/fastarray_004.phpt
diff -u /dev/null php-src/ext/spl/tests/fastarray_004.phpt:1.2
--- /dev/null   Sat Jun  7 14:10:21 2008
+++ php-src/ext/spl/tests/fastarray_004.phptSat Jun  7 14:10:21 2008
@@ -0,0 +1,16 @@
+--TEST--
+SPL: FastArray: adding new elements
+--FILE--
+?php
+
+$a = new SplFastArray(10);
+
+try {
+   $a[] = 1;
+} catch (Exception $e) {
+   var_dump($e-getMessage());
+}
+
+?
+===DONE===
+--EXPECTF--

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_005.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_005.phpt
+++ php-src/ext/spl/tests/fastarray_005.phpt
--TEST--
SPL: FastArray: Trying to instantiate passing object to constructor parameter
--FILE--
?php

$b = new stdClass;

$a = new SplFastArray($b);

?
--EXPECTF--
Warning: SplFastArray::__construct() expects parameter 1 to be long, object 
given in %s on line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_006.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_006.phpt
+++ php-src/ext/spl/tests/fastarray_006.phpt
--TEST--
SPL: FastArray: Assigning objects
--FILE--
?php

$b = 1;
$a = new SplFastArray($b);

try {
for ($i = 0; $i  100; $i++) {
$a[] = new stdClass;
}
} catch (Exception $e) {
echo $e-getMessage(), \n;
}

print ok\n;

?
--EXPECT--
Index invalid or out of range
ok

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_007.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_007.phpt
+++ php-src/ext/spl/tests/fastarray_007.phpt
--TEST--
SPL: FastArray: Assigning the itself object
--FILE--
?php

$b = 10;
$a = new SplFastArray($b);

try {
$a[1] = $a;
} catch (Exception $e) {
echo $e-getMessage(), \n;
}

foreach ($a as $c) {
if ($c) {
echo $c-getSize(), \n;
}
}

print ok\n;

?
--EXPECT--
10
ok

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_008.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_008.phpt
+++ php-src/ext/spl/tests/fastarray_008.phpt
--TEST--
SPL: FastArray: Assigning the itself object testing the reference
--FILE--
?php

$b = 3;
$a = new SplFastArray($b);

$a[0] = 1;
$a[1] = 2;
$a[2] = $a;

$a[2][0] = 3;

foreach ($a as $x) {
if (is_object($x)) {
var_dump($x[0]);
} else {
var_dump($x);
}   
}

var_dump($a-getSize());

?
--EXPECT--
int(3)
int(2)
int(3)
int(3)

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_009.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_009.phpt
+++ php-src/ext/spl/tests/fastarray_009.phpt
--TEST--
SPL: FastArray: Trying to instantiate passing string to construtor parameter
--FILE--
?php

$a = new SplFastArray('FOO');

?
--EXPECTF--
Warning: SplFastArray::__construct() expects parameter 1 to be long, string 
given in %s on line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_010.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_010.phpt
+++ php-src/ext/spl/tests/fastarray_010.phpt
--TEST--
SPL: FastArray: Setting size to 0
--FILE--
?php

$a = new SplFastArray(1);

$a[0] = 1;

$a-setSize(0);

print ok\n;

?
--EXPECT--
ok

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_011.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_011.phpt
+++ php-src/ext/spl/tests/fastarray_011.phpt
--TEST--
SPL: FastArray: Testing setSize() with NULL
--FILE--
?php

$a = new SplFastArray(100);

$a-setSize(NULL);

print ok\n;

?
--EXPECT--
ok

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_012.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_012.phpt
+++ php-src/ext/spl/tests/fastarray_012.phpt
--TEST--
SPL: FastArray: Assigning the object to another variable using []
--FILE--
?php

$a = new SplFastArray(100);

try {
$b = $a[];
} catch (Exception $e) {
echo $e-getMessage(), \n;
}

print ok\n;

?
--EXPECT--
Index invalid or out of range
ok

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_013.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_013.phpt
+++ php-src/ext/spl/tests/fastarray_013.phpt
--TEST--
SPL: FastArray: Passing the object using [] as parameter
--FILE--
?php

$a = new SplFastArray(100);


function test(SplFastArray $arr) {

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl/tests fastarray_005.phpt fastarray_006.phpt fastarray_007.phpt fastarray_008.phpt fastarray_009.phpt fastarray_010.phpt fastarray_011.phpt fastarray_012.phpt f

2008-06-07 Thread Antony Dovgal
tony2001Sat Jun  7 14:10:42 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests  fastarray_005.phpt fastarray_006.phpt 
fastarray_007.phpt fastarray_008.phpt 
fastarray_009.phpt fastarray_010.phpt 
fastarray_011.phpt fastarray_012.phpt 
fastarray_013.phpt fastarray_014.phpt 
  Log:
  add more tests (Felipe)
  
  

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_005.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_005.phpt
+++ php-src/ext/spl/tests/fastarray_005.phpt
--TEST--
SPL: FastArray: Trying to instantiate passing object to constructor parameter
--FILE--
?php

$b = new stdClass;

$a = new SplFastArray($b);

?
--EXPECTF--
Warning: SplFastArray::__construct() expects parameter 1 to be long, object 
given in %s on line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_006.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_006.phpt
+++ php-src/ext/spl/tests/fastarray_006.phpt
--TEST--
SPL: FastArray: Assigning objects
--FILE--
?php

$b = 1;
$a = new SplFastArray($b);

try {
for ($i = 0; $i  100; $i++) {
$a[] = new stdClass;
}
} catch (Exception $e) {
echo $e-getMessage(), \n;
}

print ok\n;

?
--EXPECT--
Index invalid or out of range
ok

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_007.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_007.phpt
+++ php-src/ext/spl/tests/fastarray_007.phpt
--TEST--
SPL: FastArray: Assigning the itself object
--FILE--
?php

$b = 10;
$a = new SplFastArray($b);

try {
$a[1] = $a;
} catch (Exception $e) {
echo $e-getMessage(), \n;
}

foreach ($a as $c) {
if ($c) {
echo $c-getSize(), \n;
}
}

print ok\n;

?
--EXPECT--
10
ok

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_008.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_008.phpt
+++ php-src/ext/spl/tests/fastarray_008.phpt
--TEST--
SPL: FastArray: Assigning the itself object testing the reference
--FILE--
?php

$b = 3;
$a = new SplFastArray($b);

$a[0] = 1;
$a[1] = 2;
$a[2] = $a;

$a[2][0] = 3;

foreach ($a as $x) {
if (is_object($x)) {
var_dump($x[0]);
} else {
var_dump($x);
}   
}

var_dump($a-getSize());

?
--EXPECT--
int(3)
int(2)
int(3)
int(3)

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_009.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_009.phpt
+++ php-src/ext/spl/tests/fastarray_009.phpt
--TEST--
SPL: FastArray: Trying to instantiate passing string to construtor parameter
--FILE--
?php

$a = new SplFastArray('FOO');

?
--EXPECTF--
Warning: SplFastArray::__construct() expects parameter 1 to be long, string 
given in %s on line %d

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_010.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_010.phpt
+++ php-src/ext/spl/tests/fastarray_010.phpt
--TEST--
SPL: FastArray: Setting size to 0
--FILE--
?php

$a = new SplFastArray(1);

$a[0] = 1;

$a-setSize(0);

print ok\n;

?
--EXPECT--
ok

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_011.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_011.phpt
+++ php-src/ext/spl/tests/fastarray_011.phpt
--TEST--
SPL: FastArray: Testing setSize() with NULL
--FILE--
?php

$a = new SplFastArray(100);

$a-setSize(NULL);

print ok\n;

?
--EXPECT--
ok

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_012.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_012.phpt
+++ php-src/ext/spl/tests/fastarray_012.phpt
--TEST--
SPL: FastArray: Assigning the object to another variable using []
--FILE--
?php

$a = new SplFastArray(100);

try {
$b = $a[];
} catch (Exception $e) {
echo $e-getMessage(), \n;
}

print ok\n;

?
--EXPECT--
Index invalid or out of range
ok

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_013.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_013.phpt
+++ php-src/ext/spl/tests/fastarray_013.phpt
--TEST--
SPL: FastArray: Passing the object using [] as parameter
--FILE--
?php

$a = new SplFastArray(100);


function test(SplFastArray $arr) {
print ok\n;
}

try {
test($a[]);
} catch (Exception $e) {
echo $e-getMessage(), \n;
}

?
--EXPECT--
Index invalid or out of range

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_014.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_014.phpt
+++ php-src/ext/spl/tests/fastarray_014.phpt
--TEST--
SPL: FastArray: Trying to access inexistent item
--FILE--
?php

try {
$a = new SplFastArray(NULL);
echo $a[0]++;
} catch (Exception $e) {
echo $e-getMessage();
}

?
--EXPECT--
Index invalid or out of range



-- 
PHP CVS Mailing List 

Re: [PHP-CVS] cvs: php-src /ext/spl spl_fastarray.c

2008-06-07 Thread Marcus Boerger
Hello Antony,

Saturday, June 7, 2008, 2:46:54 PM, you wrote:

 tony2001Sat Jun  7 12:46:54 2008 UTC

   Modified files:  
 /php-src/ext/splspl_fastarray.c 
   Log:
   disallow $a[] = value syntax
   
   
 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_fastarray.c?r1=1.2r2=1.3diff_format=u
 Index: php-src/ext/spl/spl_fastarray.c
 diff -u php-src/ext/spl/spl_fastarray.c:1.2 
 php-src/ext/spl/spl_fastarray.c:1.3
 --- php-src/ext/spl/spl_fastarray.c:1.2   Sat Jun  7 01:46:27 2008
 +++ php-src/ext/spl/spl_fastarray.c Sat Jun  7 12:46:54 2008
 @@ -17,7 +17,7 @@
+--+
  */
  
 -/* $Id: spl_fastarray.c,v 1.2 2008/06/07 01:46:27 colder Exp $ */
 +/* $Id: spl_fastarray.c,v 1.3 2008/06/07 12:46:54 tony2001 Exp $ */
  
  #ifdef HAVE_CONFIG_H
  #include config.h
 @@ -321,6 +321,12 @@
  {
 long index;
  
 +   if (!offset) {
 +   /* '$array[] = value' syntax is not supported */
 +   zend_throw_exception(spl_ce_RuntimeException, Index
 invalid or out of range, 0 TSRMLS_CC);

Why not use OverflowException here?


 +   return;
 +   }
 +
 index = spl_offset_convert_to_long(offset TSRMLS_CC);
  
 if (index  0 || index = intern-array-size) {






Best regards,
 Marcus


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



[PHP-CVS] cvs: CVSROOT / avail

2008-06-07 Thread Marcus Boerger
helly   Sat Jun  7 19:08:58 2008 UTC

  Modified files:  
/CVSROOTavail 
  Log:
  - Grant access to GSoC student for PHP 6 i18n work
  
http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1408r2=1.1409diff_format=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.1408 CVSROOT/avail:1.1409
--- CVSROOT/avail:1.1408Sat Jun  7 13:08:20 2008
+++ CVSROOT/avail   Sat Jun  7 19:08:58 2008
@@ -17,7 +17,7 @@
 # The PHP Developers have full access to the full source trees for
 # PHP, as well as the documentation.
 
-avail|lstrojny,dharmap,kraghuba,stevseea,colder,lwe,auroraeosrose,mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,jani,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathna,jesus,go!
 
palv,bjori,nlopess,wrowe,shire,zoe,scottmac,t2man,dsp,davidw,ab5602,nicholsr,lsmith,cellog,davidc,felipe,robinf,jmessa,philip,sixd,gwynne,ant,kalle,mattwil,sfox|phpfi,php3,php-src,pecl,non-pecl,spl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca,phpdoc-no,phd,docweb
+avail|lstrojny,dharmap,kraghuba,stevseea,colder,lwe,auroraeosrose,mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,jani,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathna,jesus,go!
 
palv,bjori,nlopess,wrowe,shire,zoe,scottmac,t2man,dsp,davidw,ab5602,nicholsr,lsmith,cellog,davidc,felipe,robinf,jmessa,philip,sixd,gwynne,ant,kalle,mattwil,sfox,hnangelo|phpfi,php3,php-src,pecl,non-pecl,spl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca,phpdoc-no,phd,docweb
 
 # Some people have access to tests in the Engine
 avail|magnus,michael,zoe,jmessa,sfox,tomerc|Zend/tests,ZendEngine2/tests



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



Re: [PHP-CVS] cvs: php-src /ext/spl spl_fastarray.c

2008-06-07 Thread Antony Dovgal

On 07.06.2008 22:59, Marcus Boerger wrote:

+   if (!offset) {
+   /* '$array[] = value' syntax is not supported */
+   zend_throw_exception(spl_ce_RuntimeException, Index
invalid or out of range, 0 TSRMLS_CC);


Why not use OverflowException here?


Do you think it's more applicable in this case?
(I have no idea myself)

--
Wbr, 
Antony Dovgal


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



[PHP-CVS] cvs: php-src /ext/date php_date.c

2008-06-07 Thread Henrique do Nascimento Angelo
hnangeloSat Jun  7 20:30:30 2008 UTC

  Modified files:  
/php-src/ext/date   php_date.c 
  Log:
  Add Unicode support and set as unicode compatible
  http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.187r2=1.188diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.187 php-src/ext/date/php_date.c:1.188
--- php-src/ext/date/php_date.c:1.187   Tue May 20 12:07:13 2008
+++ php-src/ext/date/php_date.c Sat Jun  7 20:30:30 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.187 2008/05/20 12:07:13 tony2001 Exp $ */
+/* $Id: php_date.c,v 1.188 2008/06/07 20:30:30 hnangelo Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -1214,7 +1214,7 @@
 }
 /* }}} */
 
-/* {{{ proto string date(string format [, long timestamp])
+/* {{{ proto string date(string format [, long timestamp]) U
Format a local date/time */
 PHP_FUNCTION(date)
 {
@@ -1222,7 +1222,7 @@
 }
 /* }}} */
 
-/* {{{ proto string gmdate(string format [, long timestamp])
+/* {{{ proto string gmdate(string format [, long timestamp]) U
Format a GMT date/time */
 PHP_FUNCTION(gmdate)
 {
@@ -1230,7 +1230,7 @@
 }
 /* }}} */
 
-/* {{{ proto int idate(string format [, int timestamp])
+/* {{{ proto int idate(string format [, int timestamp]) U
Format a local time/date as integer */
 PHP_FUNCTION(idate)
 {
@@ -1292,7 +1292,7 @@
 /* }}} */
 
 
-/* {{{ proto int strtotime(string time [, int now ])
+/* {{{ proto int strtotime(string time [, int now ]) U
Convert string representation of date and time to a timestamp */
 PHP_FUNCTION(strtotime)
 {
@@ -1453,7 +1453,7 @@
 }
 /* }}} */
 
-/* {{{ proto int mktime([int hour [, int min [, int sec [, int mon [, int day 
[, int year]])
+/* {{{ proto int mktime([int hour [, int min [, int sec [, int mon [, int day 
[, int year]]) U
Get UNIX timestamp for a date */
 PHP_FUNCTION(mktime)
 {
@@ -1461,7 +1461,7 @@
 }
 /* }}} */
 
-/* {{{ proto int gmmktime([int hour [, int min [, int sec [, int mon [, int 
day [, int year]])
+/* {{{ proto int gmmktime([int hour [, int min [, int sec [, int mon [, int 
day [, int year]]) U
Get UNIX timestamp for a GMT date */
 PHP_FUNCTION(gmmktime)
 {
@@ -1470,7 +1470,7 @@
 /* }}} */
 
 
-/* {{{ proto bool checkdate(int month, int day, int year)
+/* {{{ proto bool checkdate(int month, int day, int year) U
Returns true(1) if it is a valid date in gregorian calendar */
 PHP_FUNCTION(checkdate)
 {
@@ -1578,7 +1578,7 @@
 }
 /* }}} */
 
-/* {{{ proto string strftime(string format [, int timestamp])
+/* {{{ proto string strftime(string format [, int timestamp]) U
Format a local time/date according to locale settings */
 PHP_FUNCTION(strftime)
 {
@@ -1586,7 +1586,7 @@
 }
 /* }}} */
 
-/* {{{ proto string gmstrftime(string format [, int timestamp])
+/* {{{ proto string gmstrftime(string format [, int timestamp]) U
Format a GMT/UCT time/date according to locale settings */
 PHP_FUNCTION(gmstrftime)
 {
@@ -1595,7 +1595,7 @@
 /* }}} */
 #endif
 
-/* {{{ proto int time(void)
+/* {{{ proto int time(void) U
Return current UNIX timestamp */
 PHP_FUNCTION(time)
 {
@@ -1603,7 +1603,7 @@
 }
 /* }}} */
 
-/* {{{ proto array localtime([int timestamp [, bool associative_array]])
+/* {{{ proto array localtime([int timestamp [, bool associative_array]]) U
Returns the results of the C system call localtime as an associative array 
if the associative_array argument is set to 1 other wise it is a regular array 
*/
 PHP_FUNCTION(localtime)
 {
@@ -1650,7 +1650,7 @@
 }
 /* }}} */
 
-/* {{{ proto array getdate([int timestamp])
+/* {{{ proto array getdate([int timestamp]) U
Get date/time information */
 PHP_FUNCTION(getdate)
 {
@@ -1678,8 +1678,8 @@
add_ascii_assoc_long(return_value, mon, ts-m);
add_ascii_assoc_long(return_value, year, ts-y);
add_ascii_assoc_long(return_value, yday, timelib_day_of_year(ts-y, 
ts-m, ts-d));
-   add_ascii_assoc_string(return_value, weekday, 
php_date_full_day_name(ts-y, ts-m, ts-d), 1);
-   add_ascii_assoc_string(return_value, month, mon_full_names[ts-m - 
1], 1);
+   add_ascii_assoc_ascii_string(return_value, weekday, 
php_date_full_day_name(ts-y, ts-m, ts-d), 1);
+   add_ascii_assoc_ascii_string(return_value, month, 
mon_full_names[ts-m - 1], 1);
add_index_long(return_value, 0, timestamp);
 
timelib_time_dtor(ts);
@@ -2028,7 +2028,7 @@
MAKE_STD_ZVAL(zv);
switch (dateobj-time-zone_type) {
case TIMELIB_ZONETYPE_ID:
-   ZVAL_STRING(zv, dateobj-time-tz_info-name, 
1);
+   ZVAL_ASCII_STRING(zv, 
dateobj-time-tz_info-name, 1);
break;
case TIMELIB_ZONETYPE_OFFSET: {
char *tmpstr = emalloc(sizeof(UTC+05:00));
@@ -2039,11 +2039,11 @@
  

[PHP-CVS] cvs: php-src /ext/date/tests 008.phpt 011.phpt 013.phpt 014.phpt bug41523-64bit.phpt bug41523.phpt bug43808.phpt date_parse_001.phpt

2008-06-07 Thread Henrique do Nascimento Angelo
hnangeloSat Jun  7 20:33:35 2008 UTC

  Modified files:  
/php-src/ext/date/tests 008.phpt 011.phpt 013.phpt 014.phpt 
bug41523-64bit.phpt bug41523.phpt 
bug43808.phpt date_parse_001.phpt 
  Log:
  Update tests to conform with the unicode functions
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/008.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/date/tests/008.phpt
diff -u php-src/ext/date/tests/008.phpt:1.2 php-src/ext/date/tests/008.phpt:1.3
--- php-src/ext/date/tests/008.phpt:1.2 Tue May 27 18:16:00 2008
+++ php-src/ext/date/tests/008.phpt Sat Jun  7 20:33:35 2008
@@ -34,9 +34,9 @@
   [uyday]=
   int(177)
   [uweekday]=
-  string(7) Tuesday
+  unicode(7) Tuesday
   [umonth]=
-  string(4) June
+  unicode(4) June
   [0]=
   int(1151366400)
 }
@@ -58,9 +58,9 @@
   [uyday]=
   int(%d)
   [uweekday]=
-  string(%d) %s
+  unicode(%d) %s
   [umonth]=
-  string(%d) %s
+  unicode(%d) %s
   [0]=
   int(%d)
 }
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/011.phpt?r1=1.1r2=1.2diff_format=u
Index: php-src/ext/date/tests/011.phpt
diff -u php-src/ext/date/tests/011.phpt:1.1 php-src/ext/date/tests/011.phpt:1.2
--- php-src/ext/date/tests/011.phpt:1.1 Fri Dec 22 13:07:26 2006
+++ php-src/ext/date/tests/011.phpt Sat Jun  7 20:33:35 2008
@@ -16,8 +16,8 @@
 --EXPECTF--
 Warning: timezone_name_from_abbr() expects at least 1 parameter, 0 given in %s 
on line 3
 bool(false)
-string(13) Europe/Berlin
+unicode(13) Europe/Berlin
 bool(false)
 bool(false)
-string(12) Europe/Paris
+unicode(12) Europe/Paris
 Done
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/013.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/date/tests/013.phpt
diff -u php-src/ext/date/tests/013.phpt:1.3 php-src/ext/date/tests/013.phpt:1.4
--- php-src/ext/date/tests/013.phpt:1.3 Tue May 27 18:16:00 2008
+++ php-src/ext/date/tests/013.phpt Sat Jun  7 20:33:35 2008
@@ -26,7 +26,7 @@
   [utimezone_type]=
   int(3)
   [utimezone]=
-  string(3) UTC
+  unicode(3) UTC
 }
 unicode(19) 2006.12.12 00:00:00
 
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/014.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/date/tests/014.phpt
diff -u php-src/ext/date/tests/014.phpt:1.3 php-src/ext/date/tests/014.phpt:1.4
--- php-src/ext/date/tests/014.phpt:1.3 Tue May 27 18:16:00 2008
+++ php-src/ext/date/tests/014.phpt Sat Jun  7 20:33:35 2008
@@ -25,7 +25,7 @@
   [utimezone_type]=
   int(3)
   [utimezone]=
-  string(3) UTC
+  unicode(3) UTC
 }
 object(DateTimeZone)#%d (0) {
 }
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug41523-64bit.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/date/tests/bug41523-64bit.phpt
diff -u php-src/ext/date/tests/bug41523-64bit.phpt:1.3 
php-src/ext/date/tests/bug41523-64bit.phpt:1.4
--- php-src/ext/date/tests/bug41523-64bit.phpt:1.3  Tue May 27 18:16:00 2008
+++ php-src/ext/date/tests/bug41523-64bit.phpt  Sat Jun  7 20:33:35 2008
@@ -48,6 +48,6 @@
   [utimezone_type]=
   int(3)
   [utimezone]=
-  string(3) UTC
+  unicode(3) UTC
 }
 -0001-11-30T00:00:00+
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug41523.phpt?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/date/tests/bug41523.phpt
diff -u php-src/ext/date/tests/bug41523.phpt:1.5 
php-src/ext/date/tests/bug41523.phpt:1.6
--- php-src/ext/date/tests/bug41523.phpt:1.5Tue May 27 18:16:00 2008
+++ php-src/ext/date/tests/bug41523.phptSat Jun  7 20:33:35 2008
@@ -48,6 +48,6 @@
   [utimezone_type]=
   int(3)
   [utimezone]=
-  string(3) UTC
+  unicode(3) UTC
 }
 -0001-11-30T00:00:00+
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/bug43808.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/date/tests/bug43808.phpt
diff -u php-src/ext/date/tests/bug43808.phpt:1.2 
php-src/ext/date/tests/bug43808.phpt:1.3
--- php-src/ext/date/tests/bug43808.phpt:1.2Tue May 27 18:16:00 2008
+++ php-src/ext/date/tests/bug43808.phptSat Jun  7 20:33:35 2008
@@ -20,14 +20,14 @@
   [uwarnings]=
   array(1) {
 [6]=
-string(29) Double timezone specification
+unicode(29) Double timezone specification
   }
   [uerror_count]=
   int(1)
   [uerrors]=
   array(1) {
 [0]=
-string(47) The timezone could not be found in the database
+unicode(47) The timezone could not be found in the database
   }
 }
 array(4) {
@@ -36,13 +36,13 @@
   [uwarnings]=
   array(1) {
 [6]=
-string(29) Double timezone specification
+unicode(29) Double timezone specification
   }
   [uerror_count]=
   int(1)
   [uerrors]=
   array(1) {
 [0]=
-string(47) The timezone could not be found in the database
+unicode(47) The timezone could not be found in the database
   }
 }
http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/date_parse_001.phpt?r1=1.3r2=1.4diff_format=u
Index: php-src/ext/date/tests/date_parse_001.phpt
diff -u php-src/ext/date/tests/date_parse_001.phpt:1.3 
php-src/ext/date/tests/date_parse_001.phpt:1.4
--- 

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

2008-06-07 Thread Henrique do Nascimento Angelo
hnangeloSat Jun  7 20:37:11 2008 UTC

  Modified files:  
/php-src/ext/exif   exif.c 
  Log:
  Add Unicode support
  http://cvs.php.net/viewvc.cgi/php-src/ext/exif/exif.c?r1=1.201r2=1.202diff_format=u
Index: php-src/ext/exif/exif.c
diff -u php-src/ext/exif/exif.c:1.201 php-src/ext/exif/exif.c:1.202
--- php-src/ext/exif/exif.c:1.201   Wed Mar 12 17:32:26 2008
+++ php-src/ext/exif/exif.c Sat Jun  7 20:37:11 2008
@@ -17,7 +17,7 @@
+--+
  */
 
-/* $Id: exif.c,v 1.201 2008/03/12 17:32:26 iliaa Exp $ */
+/* $Id: exif.c,v 1.202 2008/06/07 20:37:11 hnangelo Exp $ */
 
 /*  ToDos
  *
@@ -142,7 +142,7 @@
 };
 /* }}} */
 
-#define EXIF_VERSION 1.4 $Id: exif.c,v 1.201 2008/03/12 17:32:26 iliaa Exp $
+#define EXIF_VERSION 1.4 $Id: exif.c,v 1.202 2008/06/07 20:37:11 hnangelo Exp 
$
 
 /* {{{ PHP_MINFO_FUNCTION
  */
@@ -1970,7 +1970,7 @@
 /* php_error_docref(NULL TSRMLS_CC, E_NOTICE, Adding infos: 
tag(0x%04X,%12s,L=0x%04X): %s, info_tag, exif_get_tagname(info_tag, buffer, 
-12, exif_get_tag_table(section_index) TSRMLS_CC), info_data-length, 
info_data-format==TAG_FMT_STRING?(info_valueinfo_value-s?info_value-s:no 
data):exif_get_tagformat(info_data-format));*/
 #endif
if (info_data-length==0) {
-   add_assoc_null(tmpi, name);
+   add_ascii_assoc_null(tmpi, name);
} else {
switch (info_data-format) {
default:
@@ -1983,9 +1983,9 @@
case TAG_FMT_SBYTE:
case TAG_FMT_UNDEFINED:
if (!info_value-s) {
-   add_assoc_stringl(tmpi, 
name, , 0, 1);
+   
add_ascii_assoc_ascii_stringl(tmpi, name, , 0, 1);
} else {
-   add_assoc_stringl(tmpi, 
name, info_value-s, info_data-length, 1);
+   
add_ascii_assoc_ascii_stringl(tmpi, name, info_value-s, info_data-length, 1);
}
break;
 
@@ -1994,9 +1994,9 @@
val = ;
}
if 
(section_index==SECTION_COMMENT) {
-   add_index_string(tmpi, 
idx++, val, 1);
+   
add_index_ascii_string(tmpi, idx++, val, 1);
} else {
-   add_assoc_string(tmpi, 
name, val, 1);
+   
add_ascii_assoc_ascii_string(tmpi, name, val, 1);
}
break;
 
@@ -2032,7 +2032,7 @@
case 
TAG_FMT_USHORT:
case 
TAG_FMT_ULONG:
if 
(l==1) {
-   
add_assoc_long(tmpi, name, (int)info_value-u);
+   
add_ascii_assoc_long(tmpi, name, (int)info_value-u);
} else {

add_index_long(array, ap, (int)info_value-u);
}
@@ -2041,9 +2041,9 @@
case 
TAG_FMT_URATIONAL:

snprintf(buffer, sizeof(buffer), %i/%i, info_value-ur.num, 
info_value-ur.den);
if 
(l==1) {
-   
add_assoc_string(tmpi, name, buffer, 1);
+   
add_ascii_assoc_ascii_string(tmpi, name, buffer, 1);
} else {
-   
add_index_string(array, ap, buffer, 1);
+   
add_index_ascii_string(array, ap, buffer, 

[PHP-CVS] cvs: php-src /ext/exif/tests bug34704.phpt exif001.phpt exif004.phpt exif005.phpt

2008-06-07 Thread Henrique do Nascimento Angelo
hnangeloSat Jun  7 20:38:38 2008 UTC

  Modified files:  
/php-src/ext/exif/tests bug34704.phpt exif001.phpt exif004.phpt 
exif005.phpt 
  Log:
  Update exif tests to conform with the unicode functions
  
http://cvs.php.net/viewvc.cgi/php-src/ext/exif/tests/bug34704.phpt?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/exif/tests/bug34704.phpt
diff -u php-src/ext/exif/tests/bug34704.phpt:1.5 
php-src/ext/exif/tests/bug34704.phpt:1.6
--- php-src/ext/exif/tests/bug34704.phpt:1.5Fri Jun  2 22:22:42 2006
+++ php-src/ext/exif/tests/bug34704.phptSat Jun  7 20:38:38 2008
@@ -13,51 +13,22 @@
 ===DONE===
 --EXPECTF--
 array(7) {
-  [FileName]=
-  string(12) bug34704.jpg
-  [FileDateTime]=
-  int(%d)
-  [FileSize]=
-  int(9976)
-  [FileType]=
-  int(2)
-  [MimeType]=
-  string(10) image/jpeg
-  [SectionsFound]=
-  string(4) IFD0
-  [COMPUTED]=
-  array(5) {
-[html]=
-string(24) width=386 height=488
-[Height]=
-int(488)
-[Width]=
-int(386)
-[IsColor]=
-int(1)
-[ByteOrderMotorola]=
-int(0)
-  }
-}
-===DONE===
---UEXPECTF--
-array(7) {
   [uFileName]=
-  string(12) bug34704.jpg
+  unicode(12) bug34704.jpg
   [uFileDateTime]=
-  int(1128867104)
+  int(%d)
   [uFileSize]=
   int(9976)
   [uFileType]=
   int(2)
   [uMimeType]=
-  string(10) image/jpeg
+  unicode(10) image/jpeg
   [uSectionsFound]=
-  string(4) IFD0
+  unicode(4) IFD0
   [uCOMPUTED]=
   array(5) {
 [uhtml]=
-string(24) width=386 height=488
+unicode(24) width=386 height=488
 [uHeight]=
 int(488)
 [uWidth]=
http://cvs.php.net/viewvc.cgi/php-src/ext/exif/tests/exif001.phpt?r1=1.6r2=1.7diff_format=u
Index: php-src/ext/exif/tests/exif001.phpt
diff -u php-src/ext/exif/tests/exif001.phpt:1.6 
php-src/ext/exif/tests/exif001.phpt:1.7
--- php-src/ext/exif/tests/exif001.phpt:1.6 Tue May 27 18:16:00 2008
+++ php-src/ext/exif/tests/exif001.phpt Sat Jun  7 20:38:38 2008
@@ -19,7 +19,7 @@
   [uFILE]=
   array(6) {
 [uFileName]=
-string(9) test2.jpg
+unicode(9) test2.jpg
 [uFileDateTime]=
 int(%d)
 [uFileSize]=
@@ -27,14 +27,14 @@
 [uFileType]=
 int(2)
 [uMimeType]=
-string(10) image/jpeg
+unicode(10) image/jpeg
 [uSectionsFound]=
-string(33) ANY_TAG, IFD0, THUMBNAIL, COMMENT
+unicode(33) ANY_TAG, IFD0, THUMBNAIL, COMMENT
   }
   [uCOMPUTED]=
   array(12) {
 [uhtml]=
-string(20) width=1 height=1
+unicode(20) width=1 height=1
 [uHeight]=
 int(1)
 [uWidth]=
@@ -44,26 +44,26 @@
 [uByteOrderMotorola]=
 int(1)
 [uUserComment]=
-string(16) Exif test image.
+unicode(16) Exif test image.
 [uUserCommentEncoding]=
-string(5) ASCII
+unicode(5) ASCII
 [uCopyright]=
-string(41) Photo (c) M.Boerger, Edited by M.Boerger.
+unicode(41) Photo (c) M.Boerger, Edited by M.Boerger.
 [uCopyright.Photographer]=
-string(19) Photo (c) M.Boerger
+unicode(19) Photo (c) M.Boerger
 [uCopyright.Editor]=
-string(20) Edited by M.Boerger.
+unicode(20) Edited by M.Boerger.
 [uThumbnail.FileType]=
 int(2)
 [uThumbnail.MimeType]=
-string(10) image/jpeg
+unicode(10) image/jpeg
   }
   [uIFD0]=
   array(2) {
 [uCopyright]=
-string(19) Photo (c) M.Boerger
+unicode(19) Photo (c) M.Boerger
 [uUserComment]=
-string(5) ASCII
+unicode(5) ASCII
   }
   [uTHUMBNAIL]=
   array(2) {
@@ -75,10 +75,10 @@
   [uCOMMENT]=
   array(3) {
 [0]=
-string(11) Comment #1.
+unicode(11) Comment #1.
 [1]=
-string(11) Comment #2.
+unicode(11) Comment #2.
 [2]=
-string(13) Comment #3end
+unicode(13) Comment #3end
   }
 }
http://cvs.php.net/viewvc.cgi/php-src/ext/exif/tests/exif004.phpt?r1=1.5r2=1.6diff_format=u
Index: php-src/ext/exif/tests/exif004.phpt
diff -u php-src/ext/exif/tests/exif004.phpt:1.5 
php-src/ext/exif/tests/exif004.phpt:1.6
--- php-src/ext/exif/tests/exif004.phpt:1.5 Sat Jan  4 19:19:59 2003
+++ php-src/ext/exif/tests/exif004.phpt Sat Jun  7 20:38:38 2008
@@ -22,17 +22,17 @@
 ?
 --EXPECT--
 array(5) {
-  [Subject]=
-  string(10) Subject...
-  [Keywords]=
-  string(11) Keywords...
-  [Author]=
-  string(9) Rui Carmo
-  [Comments]=
-  string(29) Comments
+  [uSubject]=
+  unicode(10) Subject...
+  [uKeywords]=
+  unicode(11) Keywords...
+  [uAuthor]=
+  unicode(9) Rui Carmo
+  [uComments]=
+  unicode(29) Comments
 Line2
 Line3
 Line4
-  [Title]=
-  string(8) Title...
+  [uTitle]=
+  unicode(8) Title...
 }
http://cvs.php.net/viewvc.cgi/php-src/ext/exif/tests/exif005.phpt?r1=1.8r2=1.9diff_format=u
Index: php-src/ext/exif/tests/exif005.phpt
diff -u php-src/ext/exif/tests/exif005.phpt:1.8 
php-src/ext/exif/tests/exif005.phpt:1.9
--- php-src/ext/exif/tests/exif005.phpt:1.8 Tue May 27 18:16:00 2008
+++ php-src/ext/exif/tests/exif005.phpt Sat Jun  7 20:38:38 2008
@@ -16,7 +16,7 @@
 --EXPECT--
 array(2) {
   [uImageDescription]=
-  string(11) Ifd0009
+ 

[PHP-CVS] cvs: php-src /ext/spl spl_fastarray.c /ext/spl/tests fastarray_015.phpt

2008-06-07 Thread Antony Dovgal
tony2001Sat Jun  7 21:35:53 2008 UTC

  Added files: 
/php-src/ext/spl/tests  fastarray_015.phpt 

  Modified files:  
/php-src/ext/splspl_fastarray.c 
  Log:
  more checks and tests
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_fastarray.c?r1=1.4r2=1.5diff_format=u
Index: php-src/ext/spl/spl_fastarray.c
diff -u php-src/ext/spl/spl_fastarray.c:1.4 php-src/ext/spl/spl_fastarray.c:1.5
--- php-src/ext/spl/spl_fastarray.c:1.4 Sat Jun  7 14:08:59 2008
+++ php-src/ext/spl/spl_fastarray.c Sat Jun  7 21:35:53 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: spl_fastarray.c,v 1.4 2008/06/07 14:08:59 tony2001 Exp $ */
+/* $Id: spl_fastarray.c,v 1.5 2008/06/07 21:35:53 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -292,7 +292,7 @@
 
index = spl_offset_convert_to_long(offset TSRMLS_CC);

-   if (index  0 || index = intern-array-size) {
+   if (index  0 || intern-array == NULL || index = intern-array-size) 
{
zend_throw_exception(spl_ce_RuntimeException, Index invalid or 
out of range, 0 TSRMLS_CC);
return NULL;
} else if(!intern-array-elements[index]) {
@@ -344,7 +344,7 @@
 
index = spl_offset_convert_to_long(offset TSRMLS_CC);
 
-   if (index  0 || index = intern-array-size) {
+   if (index  0 || intern-array == NULL || index = intern-array-size) 
{
zend_throw_exception(spl_ce_RuntimeException, Index invalid or 
out of range, 0 TSRMLS_CC);
return;
} else {
@@ -382,7 +382,7 @@

index = spl_offset_convert_to_long(offset TSRMLS_CC);

-   if (index  0 || index = intern-array-size) {
+   if (index  0 || intern-array == NULL || index = intern-array-size) 
{
zend_throw_exception(spl_ce_RuntimeException, Index invalid or 
out of range, 0 TSRMLS_CC);
return;
} else {
@@ -419,7 +419,7 @@

index = spl_offset_convert_to_long(offset TSRMLS_CC);

-   if (index  0 || index = intern-array-size) {
+   if (index  0 || intern-array == NULL || index = intern-array-size) 
{
retval = 0;
} else {
if (!intern-array-elements[index]) {
@@ -468,7 +468,11 @@
spl_fastarray_object *intern;

intern = (spl_fastarray_object *)zend_object_store_get_object(object 
TSRMLS_CC);
-   *count = intern-array-size;
+   if (intern-array) {
+   *count = intern-array-size;
+   } else {
+   *count = 0;
+   }
 
return SUCCESS;
 }
@@ -515,7 +519,10 @@
}
 
intern = (spl_fastarray_object *)zend_object_store_get_object(object 
TSRMLS_CC);
-   RETURN_LONG(intern-array-size);
+   if (intern-array) {
+   RETURN_LONG(intern-array-size);
+   }
+   RETURN_LONG(0);
 }
 /* }}} */
 
@@ -531,7 +538,10 @@
}
 
intern = (spl_fastarray_object *)zend_object_store_get_object(object 
TSRMLS_CC);
-   RETURN_LONG(intern-array-size);
+   if (intern-array) {
+   RETURN_LONG(intern-array-size);
+   }
+   RETURN_LONG(0);
 }
 /* }}} */
 
@@ -553,6 +563,10 @@
}
 
intern = (spl_fastarray_object *)zend_object_store_get_object(object 
TSRMLS_CC);
+   if (!intern-array) {
+   intern-array = ecalloc(1, sizeof(spl_fastarray));
+   }
+
spl_fastarray_resize(intern-array, size TSRMLS_CC);
RETURN_TRUE;
 }
@@ -668,7 +682,7 @@
return FAILURE;
}
 
-   if (iterator-object-current = 0  iterator-object-current  
iterator-object-array-size) {
+   if (iterator-object-current = 0  iterator-object-array  
iterator-object-current  iterator-object-array-size) {
return SUCCESS;
}
 
@@ -777,7 +791,7 @@
 {
spl_fastarray_object *intern = 
(spl_fastarray_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
-   RETURN_BOOL(intern-current = 0  intern-current  
intern-array-size);
+   RETURN_BOOL(intern-current = 0  intern-array  intern-current  
intern-array-size);
 }
 /* }}} */
 

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_015.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_015.phpt
+++ php-src/ext/spl/tests/fastarray_015.phpt
--TEST--
SPL: FastArray: accessing uninitialized array
--FILE--
?php

$a = new SplFastArray('');

try {
var_dump($a[1]);
} catch (Exception $e) {
echo $e-getMessage(), \n;
}
try {
$a[1] = 1;
} catch (Exception $e) {
echo $e-getMessage(), \n;
}
try {
var_dump(count($a[1]));
} catch (Exception $e) {
echo $e-getMessage(), \n;
}
try {
var_dump($a-getSize());
} catch (Exception $e) {
echo $e-getMessage(), \n;
}
try {
foreach ($a as $v) {
}
} catch (Exception $e) {
echo 

[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_fastarray.c /ext/spl/tests fastarray_015.phpt

2008-06-07 Thread Antony Dovgal
tony2001Sat Jun  7 21:36:13 2008 UTC

  Added files: (Branch: PHP_5_3)
/php-src/ext/spl/tests  fastarray_015.phpt 

  Modified files:  
/php-src/ext/splspl_fastarray.c 
  Log:
  MFH: more checks and tests
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_fastarray.c?r1=1.1.2.5r2=1.1.2.6diff_format=u
Index: php-src/ext/spl/spl_fastarray.c
diff -u php-src/ext/spl/spl_fastarray.c:1.1.2.5 
php-src/ext/spl/spl_fastarray.c:1.1.2.6
--- php-src/ext/spl/spl_fastarray.c:1.1.2.5 Sat Jun  7 14:09:06 2008
+++ php-src/ext/spl/spl_fastarray.c Sat Jun  7 21:36:13 2008
@@ -17,7 +17,7 @@
   +--+
 */
 
-/* $Id: spl_fastarray.c,v 1.1.2.5 2008/06/07 14:09:06 tony2001 Exp $ */
+/* $Id: spl_fastarray.c,v 1.1.2.6 2008/06/07 21:36:13 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include config.h
@@ -292,7 +292,7 @@
 
index = spl_offset_convert_to_long(offset TSRMLS_CC);

-   if (index  0 || index = intern-array-size) {
+   if (index  0 || intern-array == NULL || index = intern-array-size) 
{
zend_throw_exception(spl_ce_RuntimeException, Index invalid or 
out of range, 0 TSRMLS_CC);
return NULL;
} else if(!intern-array-elements[index]) {
@@ -344,7 +344,7 @@
 
index = spl_offset_convert_to_long(offset TSRMLS_CC);
 
-   if (index  0 || index = intern-array-size) {
+   if (index  0 || intern-array == NULL || index = intern-array-size) 
{
zend_throw_exception(spl_ce_RuntimeException, Index invalid or 
out of range, 0 TSRMLS_CC);
return;
} else {
@@ -382,7 +382,7 @@

index = spl_offset_convert_to_long(offset TSRMLS_CC);

-   if (index  0 || index = intern-array-size) {
+   if (index  0 || intern-array == NULL || index = intern-array-size) 
{
zend_throw_exception(spl_ce_RuntimeException, Index invalid or 
out of range, 0 TSRMLS_CC);
return;
} else {
@@ -419,7 +419,7 @@

index = spl_offset_convert_to_long(offset TSRMLS_CC);

-   if (index  0 || index = intern-array-size) {
+   if (index  0 || intern-array == NULL || index = intern-array-size) 
{
retval = 0;
} else {
if (!intern-array-elements[index]) {
@@ -468,7 +468,11 @@
spl_fastarray_object *intern;

intern = (spl_fastarray_object *)zend_object_store_get_object(object 
TSRMLS_CC);
-   *count = intern-array-size;
+   if (intern-array) {
+   *count = intern-array-size;
+   } else {
+   *count = 0;
+   }
 
return SUCCESS;
 }
@@ -515,7 +519,10 @@
}
 
intern = (spl_fastarray_object *)zend_object_store_get_object(object 
TSRMLS_CC);
-   RETURN_LONG(intern-array-size);
+   if (intern-array) {
+   RETURN_LONG(intern-array-size);
+   }
+   RETURN_LONG(0);
 }
 /* }}} */
 
@@ -531,7 +538,10 @@
}
 
intern = (spl_fastarray_object *)zend_object_store_get_object(object 
TSRMLS_CC);
-   RETURN_LONG(intern-array-size);
+   if (intern-array) {
+   RETURN_LONG(intern-array-size);
+   }
+   RETURN_LONG(0);
 }
 /* }}} */
 
@@ -553,6 +563,10 @@
}
 
intern = (spl_fastarray_object *)zend_object_store_get_object(object 
TSRMLS_CC);
+   if (!intern-array) {
+   intern-array = ecalloc(1, sizeof(spl_fastarray));
+   }
+
spl_fastarray_resize(intern-array, size TSRMLS_CC);
RETURN_TRUE;
 }
@@ -668,7 +682,7 @@
return FAILURE;
}
 
-   if (iterator-object-current = 0  iterator-object-current  
iterator-object-array-size) {
+   if (iterator-object-current = 0  iterator-object-array  
iterator-object-current  iterator-object-array-size) {
return SUCCESS;
}
 
@@ -777,7 +791,7 @@
 {
spl_fastarray_object *intern = 
(spl_fastarray_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
-   RETURN_BOOL(intern-current = 0  intern-current  
intern-array-size);
+   RETURN_BOOL(intern-current = 0  intern-array  intern-current  
intern-array-size);
 }
 /* }}} */
 

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fastarray_015.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/fastarray_015.phpt
+++ php-src/ext/spl/tests/fastarray_015.phpt
--TEST--
SPL: FastArray: accessing uninitialized array
--FILE--
?php

$a = new SplFastArray('');

try {
var_dump($a[1]);
} catch (Exception $e) {
echo $e-getMessage(), \n;
}
try {
$a[1] = 1;
} catch (Exception $e) {
echo $e-getMessage(), \n;
}
try {
var_dump(count($a[1]));
} catch (Exception $e) {
echo $e-getMessage(), \n;
}
try {
var_dump($a-getSize());
} catch (Exception $e) {
echo $e-getMessage(), \n;
}
try {
foreach ($a as $v) {
   

[PHP-CVS] cvs: php-src /ext/date php_date.c

2008-06-07 Thread Antony Dovgal
tony2001Sat Jun  7 22:41:02 2008 UTC

  Modified files:  
/php-src/ext/date   php_date.c 
  Log:
  fix ZTS build
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.188r2=1.189diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.188 php-src/ext/date/php_date.c:1.189
--- php-src/ext/date/php_date.c:1.188   Sat Jun  7 20:30:30 2008
+++ php-src/ext/date/php_date.c Sat Jun  7 22:41:02 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_date.c,v 1.188 2008/06/07 20:30:30 hnangelo Exp $ */
+/* $Id: php_date.c,v 1.189 2008/06/07 22:41:02 tony2001 Exp $ */
 
 #include php.h
 #include php_streams.h
@@ -2499,6 +2499,7 @@
 {
int   i;
zval *element;
+   TSRMLS_FETCH();
 
add_ascii_assoc_long(z, warning_count, error-warning_count);
MAKE_STD_ZVAL(element);



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



Re: [PHP-CVS] cvs: php-src /ext/date php_date.c

2008-06-07 Thread Antony Dovgal

On 08.06.2008 00:30, Henrique do Nascimento Angelo wrote:

hnangeloSat Jun  7 20:30:30 2008 UTC

  Modified files:  
/php-src/ext/date	php_date.c 
  Log:

  Add Unicode support and set as unicode compatible


Please don't forget to test your patches in ZTS mode (./configure 
--enable-maintainer-zts).

--
Wbr, 
Antony Dovgal


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