summaryrefslogtreecommitdiff
path: root/ext/date/php_date.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-08-09 14:33:59 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-08-09 14:51:25 +0200
commit3b2f2ce4748328fc696cd3d27887bf61e22ca023 (patch)
tree349c1673fafd88f006afc123d46cd78f003d87fd /ext/date/php_date.c
parent33886f710cd45fd883d85558197e2df4eaba9ea1 (diff)
downloadphp-git-3b2f2ce4748328fc696cd3d27887bf61e22ca023.tar.gz
Make uninitialized DateTime an Error
This avoids many spurious false return values.
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r--ext/date/php_date.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index aa457065d4..c3ffeba725 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -303,8 +303,8 @@ static zend_object_handlers date_object_handlers_period;
#define DATE_CHECK_INITIALIZED(member, class_name) \
if (!(member)) { \
- php_error_docref(NULL, E_WARNING, "The " #class_name " object has not been correctly initialized by its constructor"); \
- RETURN_FALSE; \
+ zend_throw_error(NULL, "The " #class_name " object has not been correctly initialized by its constructor"); \
+ return; \
}
static void date_object_free_storage_date(zend_object *object);