3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tax = bcmul("33.95", ".065"); $real_total = bcadd("33.95", "7.87"); //$real_total = bcadd($real_total, $tax); echo $real_total; function bcround($number, $scale = 0) { $fix = "5"; for ($i=0; $i<$scale; $i++) $fix = "0$fix"; $number = bcadd($number, "0.$fix", $scale + 1); return bcdiv($number, "1.0", $scale); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6aWlS
function name:  (null)
number of ops:  12
compiled vars:  !0 = $tax, !1 = $real_total
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'bcmul'
          1        SEND_VAL_EX                                              '33.95'
          2        SEND_VAL_EX                                              '.065'
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !0, $2
    3     5        INIT_FCALL_BY_NAME                                       'bcadd'
          6        SEND_VAL_EX                                              '33.95'
          7        SEND_VAL_EX                                              '7.87'
          8        DO_FCALL                                      0  $4      
          9        ASSIGN                                                   !1, $4
    6    10        ECHO                                                     !1
   12    11      > RETURN                                                   1

Function bcround:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 5
Branch analysis from position: 11
Branch analysis from position: 5
filename:       /in/6aWlS
function name:  bcround
number of ops:  27
compiled vars:  !0 = $number, !1 = $scale, !2 = $fix, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      0
    8     2        ASSIGN                                                   !2, '5'
    9     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->9
          5    >   NOP                                                      
          6        FAST_CONCAT                                      ~6      '0', !2
          7        ASSIGN                                                   !2, ~6
          8        PRE_INC                                                  !3
          9    >   IS_SMALLER                                               !3, !1
         10      > JMPNZ                                                    ~9, ->5
   10    11    >   INIT_FCALL_BY_NAME                                       'bcadd'
         12        SEND_VAR_EX                                              !0
         13        NOP                                                      
         14        FAST_CONCAT                                      ~10     '0.', !2
         15        SEND_VAL_EX                                              ~10
         16        ADD                                              ~11     !1, 1
         17        SEND_VAL_EX                                              ~11
         18        DO_FCALL                                      0  $12     
         19        ASSIGN                                                   !0, $12
   11    20        INIT_FCALL_BY_NAME                                       'bcdiv'
         21        SEND_VAR_EX                                              !0
         22        SEND_VAL_EX                                              '1.0'
         23        SEND_VAR_EX                                              !1
         24        DO_FCALL                                      0  $14     
         25      > RETURN                                                   $14
   12    26*     > RETURN                                                   null

End of function bcround

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.63 ms | 1399 KiB | 13 Q