diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-09 14:33:59 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-08-09 14:51:25 +0200 |
commit | 3b2f2ce4748328fc696cd3d27887bf61e22ca023 (patch) | |
tree | 349c1673fafd88f006afc123d46cd78f003d87fd /ext/date/php_date.c | |
parent | 33886f710cd45fd883d85558197e2df4eaba9ea1 (diff) | |
download | php-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.c | 4 |
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); |