From a498e8302140c2fed197021eefc7df60b3d27931 Mon Sep 17 00:00:00 2001 From: Boro Sitnikovski Date: Sat, 14 Sep 2013 17:18:31 +0200 Subject: [PATCH] Bug 65672 Removed function overload for write for DatePeriod. --- ext/date/php_date.c | 9 --------- ext/date/tests/bug65672.phpt | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 ext/date/tests/bug65672.phpt diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 95c68f1a78ca6..cbcfc199e9c5e 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -636,7 +636,6 @@ static HashTable *date_object_get_gc_timezone(zval *object, zval ***table, int * zval *date_interval_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC); void date_interval_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC); static zval *date_period_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC); -static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC); /* {{{ Module struct */ zend_module_entry date_module_entry = { @@ -2070,7 +2069,6 @@ static void date_register_classes(TSRMLS_D) date_object_handlers_period.get_property_ptr_ptr = NULL; date_object_handlers_period.get_gc = date_object_get_gc_period; date_object_handlers_period.read_property = date_period_read_property; - date_object_handlers_period.write_property = date_period_write_property; #define REGISTER_PERIOD_CLASS_CONST_STRING(const_name, value) \ zend_declare_class_constant_long(date_ce_period, const_name, sizeof(const_name)-1, value TSRMLS_CC); @@ -5024,13 +5022,6 @@ static zval *date_period_read_property(zval *object, zval *member, int type, con } /* }}} */ -/* {{{ date_period_write_property */ -static void date_period_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Writing to DatePeriod properties is unsupported"); -} -/* }}} */ - /* * Local variables: diff --git a/ext/date/tests/bug65672.phpt b/ext/date/tests/bug65672.phpt new file mode 100644 index 0000000000000..a669b77ea910b --- /dev/null +++ b/ext/date/tests/bug65672.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test for bug #65672: Broken classes inherited from DatePeriod +--CREDITS-- +Boro Sitnikovski +--INI-- +date.timezone = UTC +--FILE-- +recurrences; +$old_test = $p->test; + +$p->recurrences = $old_recurrence + 3; +$p->test = 123; + +var_dump($p->recurrences == $old_recurrence); +var_dump($p->test != $old_test); +var_dump($p->test == 123); + +?> +--EXPECT-- +bool(true) +bool(true) +bool(true)