3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lips_inv = 4; $bill_inv = 4; $quantity = $lips_inv + $bill_inv; $distributer_price = 440.00; function lip_price($p) { $markup = $p * 0.17; $total = $p + $markup; $rounded = ceil($total / 10) * 10; $new_price = $rounded - 1; return $new_price; } function bil_price($p) { $markup = $p * 0.20; $total = $p + $markup; $rounded = ceil($total / 10) * 10; $new_price = $rounded - 1; return $new_price; } echo "Distributer Price: $"; echo $distributer_price; echo " "; echo "Lips Inventory: "; echo $lips_inv; echo " "; echo "Bils Inventory: "; echo $bill_inv; echo " "; echo "Price: $"; if($lips_inv < 1) { if($bill_inv >= 1) { $price = bil_price($distributer_price); } else { $price = lip_price($distributer_price); } } else { $price = lip_price($distributer_price); } echo $price; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 29
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 24
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nav6C
function name:  (null)
number of ops:  35
compiled vars:  !0 = $lips_inv, !1 = $bill_inv, !2 = $quantity, !3 = $distributer_price, !4 = $price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 4
    4     1        ASSIGN                                                   !1, 4
    5     2        ADD                                              ~7      !0, !1
          3        ASSIGN                                                   !2, ~7
    7     4        ASSIGN                                                   !3, 440
   25     5        ECHO                                                     'Distributer+Price%3A+%24'
   26     6        ECHO                                                     !3
   28     7        ECHO                                                     '++++'
   30     8        ECHO                                                     'Lips+Inventory%3A+'
   31     9        ECHO                                                     !0
   33    10        ECHO                                                     '++++'
   35    11        ECHO                                                     'Bils+Inventory%3A+'
   36    12        ECHO                                                     !1
   38    13        ECHO                                                     '++++'
   40    14        ECHO                                                     'Price%3A+%24'
   41    15        IS_SMALLER                                               !0, 1
         16      > JMPZ                                                     ~10, ->29
   42    17    >   IS_SMALLER_OR_EQUAL                                      1, !1
         18      > JMPZ                                                     ~11, ->24
   43    19    >   INIT_FCALL                                               'bil_price'
         20        SEND_VAR                                                 !3
         21        DO_FCALL                                      0  $12     
         22        ASSIGN                                                   !4, $12
         23      > JMP                                                      ->28
   45    24    >   INIT_FCALL                                               'lip_price'
         25        SEND_VAR                                                 !3
         26        DO_FCALL                                      0  $14     
         27        ASSIGN                                                   !4, $14
         28    > > JMP                                                      ->33
   48    29    >   INIT_FCALL                                               'lip_price'
         30        SEND_VAR                                                 !3
         31        DO_FCALL                                      0  $16     
         32        ASSIGN                                                   !4, $16
   51    33    >   ECHO                                                     !4
   53    34      > RETURN                                                   1

Function lip_price:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nav6C
function name:  lip_price
number of ops:  15
compiled vars:  !0 = $p, !1 = $markup, !2 = $total, !3 = $rounded, !4 = $new_price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   10     1        MUL                                              ~5      !0, 0.17
          2        ASSIGN                                                   !1, ~5
   11     3        ADD                                              ~7      !0, !1
          4        ASSIGN                                                   !2, ~7
   12     5        INIT_FCALL                                               'ceil'
          6        DIV                                              ~9      !2, 10
          7        SEND_VAL                                                 ~9
          8        DO_ICALL                                         $10     
          9        MUL                                              ~11     $10, 10
         10        ASSIGN                                                   !3, ~11
   13    11        SUB                                              ~13     !3, 1
         12        ASSIGN                                                   !4, ~13
   14    13      > RETURN                                                   !4
   15    14*     > RETURN                                                   null

End of function lip_price

Function bil_price:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nav6C
function name:  bil_price
number of ops:  15
compiled vars:  !0 = $p, !1 = $markup, !2 = $total, !3 = $rounded, !4 = $new_price
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        MUL                                              ~5      !0, 0.2
          2        ASSIGN                                                   !1, ~5
   19     3        ADD                                              ~7      !0, !1
          4        ASSIGN                                                   !2, ~7
   20     5        INIT_FCALL                                               'ceil'
          6        DIV                                              ~9      !2, 10
          7        SEND_VAL                                                 ~9
          8        DO_ICALL                                         $10     
          9        MUL                                              ~11     $10, 10
         10        ASSIGN                                                   !3, ~11
   21    11        SUB                                              ~13     !3, 1
         12        ASSIGN                                                   !4, ~13
   22    13      > RETURN                                                   !4
   23    14*     > RETURN                                                   null

End of function bil_price

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
181.29 ms | 1407 KiB | 18 Q