@@ -347,11 +347,9 @@ static void _php_intlcal_before_after(
347
347
CALENDAR_METHOD_FETCH_OBJECT;
348
348
349
349
when_co = Z_INTL_CALENDAR_P (when_object);
350
- /* Can this ever happen ? */
351
350
if (when_co->ucal == NULL ) {
352
- intl_errors_set (&co->err , U_ILLEGAL_ARGUMENT_ERROR,
353
- " intlcal_before/after: Other IntlCalendar was unconstructed" , 0 );
354
- RETURN_FALSE;
351
+ zend_argument_error (NULL , 2 , " object is not fully initialized" );
352
+ RETURN_THROWS ();
355
353
}
356
354
357
355
UBool res = (co->ucal ->*func)(*when_co->ucal , CALENDAR_ERROR_CODE (co));
@@ -716,11 +714,9 @@ U_CFUNC PHP_FUNCTION(intlcal_is_equivalent_to)
716
714
}
717
715
718
716
other_co = Z_INTL_CALENDAR_P (other_object);
719
- // Can this happen?
720
717
if (other_co->ucal == NULL ) {
721
- intl_error_set (NULL , U_ILLEGAL_ARGUMENT_ERROR, " intlcal_is_equivalent_to:"
722
- " Other IntlCalendar is unconstructed" , 0 );
723
- RETURN_FALSE;
718
+ zend_argument_error (NULL , 2 , " object is not fully initialized" );
719
+ RETURN_THROWS ();
724
720
}
725
721
726
722
CALENDAR_METHOD_FETCH_OBJECT;
@@ -856,11 +852,9 @@ U_CFUNC PHP_FUNCTION(intlcal_equals)
856
852
857
853
CALENDAR_METHOD_FETCH_OBJECT;
858
854
other_co = Z_INTL_CALENDAR_P (other_object);
859
- // Can this happen?
860
855
if (other_co->ucal == NULL ) {
861
- intl_errors_set (&co->err , U_ILLEGAL_ARGUMENT_ERROR,
862
- " intlcal_equals: The second IntlCalendar is unconstructed" , 0 );
863
- RETURN_FALSE;
856
+ zend_argument_error (NULL , 2 , " object is not fully initialized" );
857
+ RETURN_THROWS ();
864
858
}
865
859
866
860
UBool result = co->ucal ->equals (*other_co->ucal , CALENDAR_ERROR_CODE (co));
@@ -1085,6 +1079,7 @@ U_CFUNC PHP_FUNCTION(intlcal_to_date_time)
1085
1079
object_init_ex (return_value, php_date_get_date_ce ());
1086
1080
zend_call_known_instance_method_with_2_params (
1087
1081
Z_OBJCE_P (return_value)->constructor , Z_OBJ_P (return_value), NULL , &ts_zval, timezone_zval);
1082
+ // TODO Bubble up exception?
1088
1083
if (EG (exception )) {
1089
1084
intl_errors_set (CALENDAR_ERROR_P (co), U_ILLEGAL_ARGUMENT_ERROR,
1090
1085
" intlcal_to_date_time: DateTime constructor has thrown exception" ,
0 commit comments