3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array("3.45Lt", "1.00€"); function kazkas($match){ if($match[3]==="LTL"){ $match[3] = "EUR"; } elseif($match[3]==="Lt" | $match[3]==="LT" | $match[3]==="lT" |$match[3] === "lt"){ $match[3] = "€"; }else{ $match[3]=$match[3]; } $changeratio = 3.4488; return number_format($match[1]/$changeratio,2).$match[2].$match[3]; //3.4492 } $result = preg_replace_callback('/(\d+[,.]?\d?)(\s?)(L+T+L?)/iD','kazkas',$input); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vhg2D
function name:  (null)
number of ops:  11
compiled vars:  !0 = $input, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   16     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%28%5Cd%2B%5B%2C.%5D%3F%5Cd%3F%29%28%5Cs%3F%29%28L%2BT%2BL%3F%29%2FiD'
          3        SEND_VAL                                                 'kazkas'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !1, $3
   17     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Function kazkas:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vhg2D
function name:  kazkas
number of ops:  38
compiled vars:  !0 = $match, !1 = $changeratio
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        FETCH_DIM_R                                      ~2      !0, 3
          2        IS_IDENTICAL                                             ~2, 'LTL'
          3      > JMPZ                                                     ~3, ->7
    5     4    >   ASSIGN_DIM                                               !0, 3
          5        OP_DATA                                                  'EUR'
          6      > JMP                                                      ->25
    7     7    >   FETCH_DIM_R                                      ~5      !0, 3
          8        IS_IDENTICAL                                     ~6      ~5, 'Lt'
          9        FETCH_DIM_R                                      ~7      !0, 3
         10        IS_IDENTICAL                                     ~8      ~7, 'LT'
         11        BW_OR                                            ~9      ~6, ~8
         12        FETCH_DIM_R                                      ~10     !0, 3
         13        IS_IDENTICAL                                     ~11     ~10, 'lT'
         14        BW_OR                                            ~12     ~9, ~11
         15        FETCH_DIM_R                                      ~13     !0, 3
         16        IS_IDENTICAL                                     ~14     ~13, 'lt'
         17        BW_OR                                            ~15     ~12, ~14
         18      > JMPZ                                                     ~15, ->22
    8    19    >   ASSIGN_DIM                                               !0, 3
         20        OP_DATA                                                  '%E2%82%AC'
         21      > JMP                                                      ->25
   10    22    >   FETCH_DIM_R                                      ~18     !0, 3
         23        ASSIGN_DIM                                               !0, 3
         24        OP_DATA                                                  ~18
   12    25    >   ASSIGN                                                   !1, 3.4488
   13    26        INIT_FCALL                                               'number_format'
         27        FETCH_DIM_R                                      ~20     !0, 1
         28        DIV                                              ~21     ~20, !1
         29        SEND_VAL                                                 ~21
         30        SEND_VAL                                                 2
         31        DO_ICALL                                         $22     
         32        FETCH_DIM_R                                      ~23     !0, 2
         33        CONCAT                                           ~24     $22, ~23
         34        FETCH_DIM_R                                      ~25     !0, 3
         35        CONCAT                                           ~26     ~24, ~25
         36      > RETURN                                                   ~26
   15    37*     > RETURN                                                   null

End of function kazkas

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.65 ms | 1400 KiB | 19 Q