File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -4189,6 +4189,7 @@ PHP_METHOD(DatePeriod, getStartDate)
41894189 ZEND_PARSE_PARAMETERS_NONE ();
41904190
41914191 dpobj = Z_PHPPERIOD_P (ZEND_THIS );
4192+ DATE_CHECK_INITIALIZED (dpobj -> start , DatePeriod );
41924193
41934194 php_date_instantiate (dpobj -> start_ce , return_value );
41944195 dateobj = Z_PHPDATE_P (return_value );
@@ -4239,6 +4240,7 @@ PHP_METHOD(DatePeriod, getDateInterval)
42394240 ZEND_PARSE_PARAMETERS_NONE ();
42404241
42414242 dpobj = Z_PHPPERIOD_P (ZEND_THIS );
4243+ DATE_CHECK_INITIALIZED (dpobj -> interval , DatePeriod );
42424244
42434245 php_date_instantiate (date_ce_interval , return_value );
42444246 diobj = Z_PHPINTERVAL_P (return_value );
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ class _t extends DateTimeZone {
1111 function __construct () {
1212 }
1313}
14+ class _p extends DatePeriod {
15+ function __construct () {
16+ }
17+ }
1418
1519$ d = new DateTime ;
1620var_dump ($ d ->format ("Y-m-d H:i:s " ));
4448 echo $ e ->getMessage (),"\n" ;
4549}
4650
51+ $ p = new _p ;
52+ try {
53+ var_dump ($ p ->getStartDate ());
54+ } catch (Error $ e ) {
55+ echo $ e ->getMessage (),"\n" ;
56+ }
57+ try {
58+ var_dump ($ p ->getDateInterval ());
59+ } catch (Error $ e ) {
60+ echo $ e ->getMessage (),"\n" ;
61+ }
62+
4763echo "DONE \n" ;
4864?>
4965--EXPECTF--
@@ -53,4 +69,6 @@ DateTime::__construct(): Failed to parse time string (1am todax) at position 4 (
5369string(3) "UTC"
5470The DateTimeZone object has not been correctly initialized by its constructor
5571DateTimeZone::__construct(): Unknown or bad timezone (GottaFindThisOne)
72+ The DatePeriod object has not been correctly initialized by its constructor
73+ The DatePeriod object has not been correctly initialized by its constructor
5674DONE
You can’t perform that action at this time.
0 commit comments