@@ -837,8 +837,6 @@ ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(zval *op, bool is_strict) /*
837
837
if (UNEXPECTED (is_strict )) {
838
838
if (!zend_is_long_compatible (dval , lval )) {
839
839
zend_incompatible_double_to_long_error (dval );
840
- // TODO Need to handle this here?
841
- //if (UNEXPECTED(EG(exception))) {}
842
840
}
843
841
}
844
842
return lval ;
@@ -863,8 +861,6 @@ ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(zval *op, bool is_strict) /*
863
861
if (UNEXPECTED (is_strict )) {
864
862
if (!zend_is_long_compatible (dval , lval )) {
865
863
zend_incompatible_string_to_long_error (Z_STR_P (op ));
866
- // TODO Need to handle this here?
867
- //if (UNEXPECTED(EG(exception))) {}
868
864
}
869
865
}
870
866
return lval ;
@@ -1499,10 +1495,17 @@ ZEND_API zend_result ZEND_FASTCALL bitwise_not_function(zval *result, zval *op1)
1499
1495
case IS_LONG :
1500
1496
ZVAL_LONG (result , ~Z_LVAL_P (op1 ));
1501
1497
return SUCCESS ;
1502
- case IS_DOUBLE :
1503
- // TODO Handle manually in case deprecation notice promoted to Exception?
1504
- ZVAL_LONG (result , ~zend_dval_to_lval_safe (Z_DVAL_P (op1 )));
1498
+ case IS_DOUBLE : {
1499
+ zend_long lval = zend_dval_to_lval (Z_DVAL_P (op1 ));
1500
+ if (!zend_is_long_compatible (Z_DVAL_P (op1 ), lval )) {
1501
+ zend_incompatible_double_to_long_error (Z_DVAL_P (op1 ));
1502
+ if (EG (exception )) {
1503
+ return FAILURE ;
1504
+ }
1505
+ }
1506
+ ZVAL_LONG (result , ~lval );
1505
1507
return SUCCESS ;
1508
+ }
1506
1509
case IS_STRING : {
1507
1510
size_t i ;
1508
1511
0 commit comments