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)
4189
4189
ZEND_PARSE_PARAMETERS_NONE ();
4190
4190
4191
4191
dpobj = Z_PHPPERIOD_P (ZEND_THIS );
4192
+ DATE_CHECK_INITIALIZED (dpobj -> start , DatePeriod );
4192
4193
4193
4194
php_date_instantiate (dpobj -> start_ce , return_value );
4194
4195
dateobj = Z_PHPDATE_P (return_value );
@@ -4239,6 +4240,7 @@ PHP_METHOD(DatePeriod, getDateInterval)
4239
4240
ZEND_PARSE_PARAMETERS_NONE ();
4240
4241
4241
4242
dpobj = Z_PHPPERIOD_P (ZEND_THIS );
4243
+ DATE_CHECK_INITIALIZED (dpobj -> interval , DatePeriod );
4242
4244
4243
4245
php_date_instantiate (date_ce_interval , return_value );
4244
4246
diobj = Z_PHPINTERVAL_P (return_value );
Original file line number Diff line number Diff line change @@ -11,6 +11,10 @@ class _t extends DateTimeZone {
11
11
function __construct () {
12
12
}
13
13
}
14
+ class _p extends DatePeriod {
15
+ function __construct () {
16
+ }
17
+ }
14
18
15
19
$ d = new DateTime ;
16
20
var_dump ($ d ->format ("Y-m-d H:i:s " ));
44
48
echo $ e ->getMessage (),"\n" ;
45
49
}
46
50
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
+
47
63
echo "DONE \n" ;
48
64
?>
49
65
--EXPECTF--
@@ -53,4 +69,6 @@ DateTime::__construct(): Failed to parse time string (1am todax) at position 4 (
53
69
string(3) "UTC"
54
70
The DateTimeZone object has not been correctly initialized by its constructor
55
71
DateTimeZone::__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
56
74
DONE
You can’t perform that action at this time.
0 commit comments