@@ -4793,7 +4793,7 @@ static HashTable *date_object_get_properties_period(zend_object *object) /* {{{
4793
4793
4794
4794
if (period_obj -> start ) {
4795
4795
php_date_obj * date_obj ;
4796
- object_init_ex (& zv , date_ce_date );
4796
+ object_init_ex (& zv , period_obj -> start_ce );
4797
4797
date_obj = Z_PHPDATE_P (& zv );
4798
4798
date_obj -> time = timelib_time_clone (period_obj -> start );
4799
4799
} else {
@@ -4803,7 +4803,7 @@ static HashTable *date_object_get_properties_period(zend_object *object) /* {{{
4803
4803
4804
4804
if (period_obj -> current ) {
4805
4805
php_date_obj * date_obj ;
4806
- object_init_ex (& zv , date_ce_date );
4806
+ object_init_ex (& zv , period_obj -> start_ce );
4807
4807
date_obj = Z_PHPDATE_P (& zv );
4808
4808
date_obj -> time = timelib_time_clone (period_obj -> current );
4809
4809
} else {
@@ -4813,7 +4813,7 @@ static HashTable *date_object_get_properties_period(zend_object *object) /* {{{
4813
4813
4814
4814
if (period_obj -> end ) {
4815
4815
php_date_obj * date_obj ;
4816
- object_init_ex (& zv , date_ce_date );
4816
+ object_init_ex (& zv , period_obj -> start_ce );
4817
4817
date_obj = Z_PHPDATE_P (& zv );
4818
4818
date_obj -> time = timelib_time_clone (period_obj -> end );
4819
4819
} else {
@@ -4850,7 +4850,7 @@ static int php_date_period_initialize_from_hash(php_period_obj *period_obj, Hash
4850
4850
4851
4851
ht_entry = zend_hash_str_find (myht , "start" , sizeof ("start" )- 1 );
4852
4852
if (ht_entry ) {
4853
- if (Z_TYPE_P (ht_entry ) == IS_OBJECT && Z_OBJCE_P (ht_entry ) == date_ce_date ) {
4853
+ if (Z_TYPE_P (ht_entry ) == IS_OBJECT && instanceof_function ( Z_OBJCE_P (ht_entry ), date_ce_interface ) ) {
4854
4854
php_date_obj * date_obj ;
4855
4855
date_obj = Z_PHPDATE_P (ht_entry );
4856
4856
period_obj -> start = timelib_time_clone (date_obj -> time );
@@ -4864,7 +4864,7 @@ static int php_date_period_initialize_from_hash(php_period_obj *period_obj, Hash
4864
4864
4865
4865
ht_entry = zend_hash_str_find (myht , "end" , sizeof ("end" )- 1 );
4866
4866
if (ht_entry ) {
4867
- if (Z_TYPE_P (ht_entry ) == IS_OBJECT && Z_OBJCE_P (ht_entry ) == date_ce_date ) {
4867
+ if (Z_TYPE_P (ht_entry ) == IS_OBJECT && instanceof_function ( Z_OBJCE_P (ht_entry ), date_ce_interface ) ) {
4868
4868
php_date_obj * date_obj ;
4869
4869
date_obj = Z_PHPDATE_P (ht_entry );
4870
4870
period_obj -> end = timelib_time_clone (date_obj -> time );
@@ -4877,7 +4877,7 @@ static int php_date_period_initialize_from_hash(php_period_obj *period_obj, Hash
4877
4877
4878
4878
ht_entry = zend_hash_str_find (myht , "current" , sizeof ("current" )- 1 );
4879
4879
if (ht_entry ) {
4880
- if (Z_TYPE_P (ht_entry ) == IS_OBJECT && Z_OBJCE_P (ht_entry ) == date_ce_date ) {
4880
+ if (Z_TYPE_P (ht_entry ) == IS_OBJECT && instanceof_function ( Z_OBJCE_P (ht_entry ), date_ce_interface ) ) {
4881
4881
php_date_obj * date_obj ;
4882
4882
date_obj = Z_PHPDATE_P (ht_entry );
4883
4883
period_obj -> current = timelib_time_clone (date_obj -> time );
0 commit comments