3v4l.org

run code in 300+ PHP versions simultaneously
<?php $atax = json_decode('{"dynamic":true,"taxId":"1","taxRate":"18.00","taxMethod":"Inclusive","taxName":"VAT 18%"}'); print_r($atax); $ataxTotal = $atax->taxMethod == 'Exlusive' ? floatval("1000") * $atax->taxRate * 0.01 : floatval("1000") * (1 + 100 / $atax->taxRate); echo $ataxTotal;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PSZlK
function name:  (null)
number of ops:  25
compiled vars:  !0 = $atax, !1 = $ataxTotal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%22dynamic%22%3Atrue%2C%22taxId%22%3A%221%22%2C%22taxRate%22%3A%2218.00%22%2C%22taxMethod%22%3A%22Inclusive%22%2C%22taxName%22%3A%22VAT+18%25%22%7D'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    4     4        INIT_FCALL                                               'print_r'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
    5     7        FETCH_OBJ_R                                      ~5      !0, 'taxMethod'
          8        IS_EQUAL                                                 ~5, 'Exlusive'
          9      > JMPZ                                                     ~6, ->16
         10    >   CAST                                          5  ~7      '1000'
         11        FETCH_OBJ_R                                      ~8      !0, 'taxRate'
         12        MUL                                              ~9      ~7, ~8
         13        MUL                                              ~10     ~9, 0.01
         14        QM_ASSIGN                                        ~11     ~10
         15      > JMP                                                      ->22
         16    >   CAST                                          5  ~12     '1000'
         17        FETCH_OBJ_R                                      ~13     !0, 'taxRate'
         18        DIV                                              ~14     100, ~13
         19        ADD                                              ~15     1, ~14
         20        MUL                                              ~16     ~12, ~15
         21        QM_ASSIGN                                        ~11     ~16
         22    >   ASSIGN                                                   !1, ~11
    6    23        ECHO                                                     !1
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.36 ms | 1395 KiB | 17 Q