jani Wed Jul 30 08:18:06 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/date php_date.c Log: MFH:ws http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.51.2.50&r2=1.43.2.45.2.51.2.51&diff_format=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.45.2.51.2.50 php-src/ext/date/php_date.c:1.43.2.45.2.51.2.51 --- php-src/ext/date/php_date.c:1.43.2.45.2.51.2.50 Tue Jul 29 12:56:52 2008 +++ php-src/ext/date/php_date.c Wed Jul 30 08:18:05 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_date.c,v 1.43.2.45.2.51.2.50 2008/07/29 12:56:52 dmitry Exp $ */ +/* $Id: php_date.c,v 1.43.2.45.2.51.2.51 2008/07/30 08:18:05 jani Exp $ */ #include "php.h" #include "php_streams.h" @@ -652,8 +652,8 @@ /* This is need to ensure that session extension request shutdown occurs 1st, because it uses the date extension */ static const zend_module_dep date_deps[] = { - ZEND_MOD_OPTIONAL("session") - {NULL, NULL, NULL} + ZEND_MOD_OPTIONAL("session") + {NULL, NULL, NULL} }; /* {{{ Module struct */ @@ -1973,21 +1973,21 @@ zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC) { - date_period_it *iterator = emalloc(sizeof(date_period_it)); - php_period_obj *dpobj = (php_period_obj *)zend_object_store_get_object(object TSRMLS_CC); + date_period_it *iterator = emalloc(sizeof(date_period_it)); + php_period_obj *dpobj = (php_period_obj *)zend_object_store_get_object(object TSRMLS_CC); + + if (by_ref) { + zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); + } - if (by_ref) { - zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); - } - - Z_ADDREF_P(object); - iterator->intern.data = (void*) dpobj; - iterator->intern.funcs = &date_period_it_funcs; + Z_ADDREF_P(object); + iterator->intern.data = (void*) dpobj; + iterator->intern.funcs = &date_period_it_funcs; iterator->date_period_zval = object; - iterator->object = dpobj; - iterator->current = NULL; + iterator->object = dpobj; + iterator->current = NULL; - return (zend_object_iterator*)iterator; + return (zend_object_iterator*)iterator; } static void date_register_classes(TSRMLS_D)
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php