com php-src: cleanup: Zend/zend_API.h ext/date/php_date .c
| From: | Xinchen Hui | Date: | Thu, 14 Aug 2014 04:15:24 +0000 |
| Subject: | com php-src: cleanup: Zend/zend_API.h ext/date/php_date .c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79854@lists.php.net to get a copy of this message | ||
Commit: c749fe2067d29615df250e59c9a891a63dcc7e7f
Author: Xinchen Hui <laruence@php.net> Thu, 14 Aug 2014 12:15:24 +0800
Parents: bfc1ae07bec3bda6dc0522da50b35ba093d4247c
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c749fe2067d29615df250e59c9a891a63dcc7e7f
Log:
cleanup
Changed paths:
M Zend/zend_API.h
M ext/date/php_date.c
Diff:
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index da7d203..b40afc1 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -646,6 +646,7 @@ END_EXTERN_C()
} \
} while (0)
#else // attempt to support calls to parent::__construct() ???
+ // see: ext/date/tests/bug67118.phpt
#define ZEND_CTOR_MAKE_NULL() do { \
if (EG(current_execute_data)->return_value) { \
zval_ptr_dtor(EG(current_execute_data)->return_value); \
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 49dab65..cc0499d 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2147,8 +2147,6 @@ static zend_object *date_object_clone_date(zval *this_ptr TSRMLS_DC) /* {{{ */
static void date_clone_immutable(zval *object, zval *new_object TSRMLS_DC) /* {{{ */
{
ZVAL_OBJ(new_object, date_object_clone_date(object TSRMLS_CC));
-//??? Z_SET_REFCOUNT_P(new_object, 1);
-//??? Z_SET_ISREF_P(new_object);
} /* }}} */
static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) /* {{{ */
@@ -2416,7 +2414,7 @@ static inline zend_object *date_object_new_period_ex(zend_class_entry
*class_typ
if (init_props) {
object_properties_init(&intern->std, class_type);
}
-//??? date_object_free_storage_period, NULL TSRMLS_CC);
+
intern->std.handlers = &date_object_handlers_period;
return &intern->std;
@@ -3672,7 +3670,7 @@ PHP_METHOD(DateTimeZone, __construct)
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz,
&tz_len)) {
tzobj = Z_PHPTIMEZONE_P(getThis());
if (FAILURE == timezone_initialize(tzobj, tz TSRMLS_CC)) {
-//??? ZVAL_NULL(getThis());
+ ZEND_CTOR_MAKE_NULL();
}
}
zend_restore_error_handling(&error_handling TSRMLS_CC);
@@ -4096,8 +4094,8 @@ PHP_METHOD(DateInterval, __construct)
diobj = Z_PHPINTERVAL_P(getThis());
diobj->diff = reltime;
diobj->initialized = 1;
-//??? } else {
-//??? ZVAL_NULL(getThis());
+ } else {
+ ZEND_CTOR_MAKE_NULL();
}
}
zend_restore_error_handling(&error_handling TSRMLS_CC);