3v4l.org

run code in 300+ PHP versions simultaneously
<?php $clientTotal = 0.00000; $vendorTotal = 1234; $profitMarginPercent = round((($clientTotal - $vendorTotal + PHP_FLOAT_EPSILON)/$vendorTotal) * 100, 2); $profitMarginPercent = ($profitMarginPercent > 0.0 ? "+" : "") . $profitMarginPercent; echo $profitMarginPercent . PHP_EOL; $clientTotal = 89.64110; $vendorTotal = 89.64110; $profitMarginPercent = round((($clientTotal - $vendorTotal + PHP_FLOAT_EPSILON)/$vendorTotal) * 100, 2); $profitMarginPercent = ($profitMarginPercent > 0.0 ? "+" : "") . $profitMarginPercent; echo $profitMarginPercent . PHP_EOL; $clientTotal = 89.64110; $vendorTotal = 75.34; $profitMarginPercent = round((($clientTotal - $vendorTotal + PHP_FLOAT_EPSILON)/$vendorTotal) * 100, 2); $profitMarginPercent = ($profitMarginPercent > 0.0 ? "+" : "") . $profitMarginPercent; echo $profitMarginPercent . PHP_EOL;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
Branch analysis from position: 55
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
Branch analysis from position: 35
filename:       /in/j5BR7
function name:  (null)
number of ops:  61
compiled vars:  !0 = $clientTotal, !1 = $vendorTotal, !2 = $profitMarginPercent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 0
    4     1        ASSIGN                                                   !1, 1234
    6     2        INIT_FCALL                                               'round'
          3        SUB                                              ~5      !0, !1
          4        ADD                                              ~6      ~5, 2.22045e-16
          5        DIV                                              ~7      ~6, !1
          6        MUL                                              ~8      ~7, 100
          7        SEND_VAL                                                 ~8
          8        SEND_VAL                                                 2
          9        DO_ICALL                                         $9      
         10        ASSIGN                                                   !2, $9
    7    11        IS_SMALLER                                               0, !2
         12      > JMPZ                                                     ~11, ->15
         13    >   QM_ASSIGN                                        ~12     '%2B'
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~12     ''
         16    >   CONCAT                                           ~13     ~12, !2
         17        ASSIGN                                                   !2, ~13
    9    18        CONCAT                                           ~15     !2, '%0A'
         19        ECHO                                                     ~15
   11    20        ASSIGN                                                   !0, 89.6411
   12    21        ASSIGN                                                   !1, 89.6411
   14    22        INIT_FCALL                                               'round'
         23        SUB                                              ~18     !0, !1
         24        ADD                                              ~19     ~18, 2.22045e-16
         25        DIV                                              ~20     ~19, !1
         26        MUL                                              ~21     ~20, 100
         27        SEND_VAL                                                 ~21
         28        SEND_VAL                                                 2
         29        DO_ICALL                                         $22     
         30        ASSIGN                                                   !2, $22
   15    31        IS_SMALLER                                               0, !2
         32      > JMPZ                                                     ~24, ->35
         33    >   QM_ASSIGN                                        ~25     '%2B'
         34      > JMP                                                      ->36
         35    >   QM_ASSIGN                                        ~25     ''
         36    >   CONCAT                                           ~26     ~25, !2
         37        ASSIGN                                                   !2, ~26
   17    38        CONCAT                                           ~28     !2, '%0A'
         39        ECHO                                                     ~28
   19    40        ASSIGN                                                   !0, 89.6411
   20    41        ASSIGN                                                   !1, 75.34
   22    42        INIT_FCALL                                               'round'
         43        SUB                                              ~31     !0, !1
         44        ADD                                              ~32     ~31, 2.22045e-16
         45        DIV                                              ~33     ~32, !1
         46        MUL                                              ~34     ~33, 100
         47        SEND_VAL                                                 ~34
         48        SEND_VAL                                                 2
         49        DO_ICALL                                         $35     
         50        ASSIGN                                                   !2, $35
   23    51        IS_SMALLER                                               0, !2
         52      > JMPZ                                                     ~37, ->55
         53    >   QM_ASSIGN                                        ~38     '%2B'
         54      > JMP                                                      ->56
         55    >   QM_ASSIGN                                        ~38     ''
         56    >   CONCAT                                           ~39     ~38, !2
         57        ASSIGN                                                   !2, ~39
   25    58        CONCAT                                           ~41     !2, '%0A'
         59        ECHO                                                     ~41
   26    60      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.69 ms | 1007 KiB | 14 Q