@@ -303,14 +303,16 @@ static zend_never_inline zend_long ZEND_FASTCALL zendi_try_get_long(zval *op, bo
303
303
return 0 ;
304
304
case IS_TRUE :
305
305
return 1 ;
306
- case IS_DOUBLE :
307
- if (!is_long_compatible (Z_DVAL_P (op ))) {
308
- zend_error (E_DEPRECATED , "Implicit conversion to int from non-compatible float %f" , Z_DVAL_P (op ));
306
+ case IS_DOUBLE : {
307
+ double dval = Z_DVAL_P (op );
308
+ if (!is_long_compatible (dval )) {
309
+ zend_error (E_DEPRECATED , "Implicit conversion to int from non-compatible float %f" , dval );
309
310
if (UNEXPECTED (EG (exception ))) {
310
311
* failed = 1 ;
311
312
}
312
313
}
313
- return zend_dval_to_lval (Z_DVAL_P (op ));
314
+ return zend_dval_to_lval (dval );
315
+ }
314
316
case IS_STRING :
315
317
{
316
318
zend_uchar type ;
@@ -820,15 +822,17 @@ ZEND_API zend_long ZEND_FASTCALL zval_get_long_func(zval *op, bool is_lax) /* {{
820
822
return Z_RES_HANDLE_P (op );
821
823
case IS_LONG :
822
824
return Z_LVAL_P (op );
823
- case IS_DOUBLE :
825
+ case IS_DOUBLE : {
826
+ double dval = Z_DVAL_P (op );
824
827
if (EXPECTED (!is_lax )) {
825
- if (!is_long_compatible (Z_DVAL_P ( op ) )) {
826
- zend_error (E_DEPRECATED , "Implicit conversion to int from non-compatible float %f" , Z_DVAL_P ( op ) );
828
+ if (!is_long_compatible (dval )) {
829
+ zend_error (E_DEPRECATED , "Implicit conversion to int from non-compatible float %f" , dval );
827
830
// TODO Need to handle this here?
828
831
//if (UNEXPECTED(EG(exception))) {}
829
832
}
830
833
}
831
- return zend_dval_to_lval (Z_DVAL_P (op ));
834
+ return zend_dval_to_lval (dval );
835
+ }
832
836
case IS_STRING :
833
837
{
834
838
zend_uchar type ;
0 commit comments