3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sumPrice = 5.00; $subtotal = 0.00; $voucherSum = sprintf('%01.2f', (sprintf('%01.2f',$sumPrice) - sprintf('%01.2f',$subtotal))); $parameter['has_voucher'] = (abs($voucherSum) >= 0.01) ? 1 : 0; var_dump($voucherSum); var_dump($parameter);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R0krD
function name:  (null)
number of ops:  33
compiled vars:  !0 = $sumPrice, !1 = $subtotal, !2 = $voucherSum, !3 = $parameter
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    4     1        ASSIGN                                                   !1, 0
    6     2        INIT_FCALL                                               'sprintf'
          3        SEND_VAL                                                 '%2501.2f'
          4        INIT_FCALL                                               'sprintf'
          5        SEND_VAL                                                 '%2501.2f'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        INIT_FCALL                                               'sprintf'
          9        SEND_VAL                                                 '%2501.2f'
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $7      
         12        SUB                                              ~8      $6, $7
         13        SEND_VAL                                                 ~8
         14        DO_ICALL                                         $9      
         15        ASSIGN                                                   !2, $9
    7    16        INIT_FCALL                                               'abs'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                         $12     
         19        IS_SMALLER_OR_EQUAL                                      0.01, $12
         20      > JMPZ                                                     ~13, ->23
         21    >   QM_ASSIGN                                        ~14     1
         22      > JMP                                                      ->24
         23    >   QM_ASSIGN                                        ~14     0
         24    >   ASSIGN_DIM                                               !3, 'has_voucher'
         25        OP_DATA                                                  ~14
    9    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !2
         28        DO_ICALL                                                 
   10    29        INIT_FCALL                                               'var_dump'
         30        SEND_VAR                                                 !3
         31        DO_ICALL                                                 
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.43 ms | 1396 KiB | 19 Q