3v4l.org

run code in 300+ PHP versions simultaneously
<?php $price = 10; $currencyCode = 'EUR'; switch ($currencyCode) { case 'EUR': $price_tab = explode('.',$price); if (sizeof($price_tab) == 2) { if ($price_tab[1] == '00') { $price = $price_tab[0].'€'; } else { $price = $price_tab[0].','.$price_tab[1].'€'; } } elseif (is_numeric($price)) { $price = $price.'€'; } break; case 'CHF': $price_tab = explode('.', $price); if (sizeof($price_tab) == 2) { if ($price_tab[1] == '00') { $price = 'CHF '.$price_tab[0].'.-'; } else { $price = 'CHF '.$price; } } elseif (is_numeric($price)) { $price = 'CHF '.$price.'.-'; } break; default: return $price; break; } echo $price; ?>
Finding entry points
Branch analysis from position: 0
4 jumps found. (Code = 188) Position 1 = 8, Position 2 = 37, Position 3 = 64, Position 4 = 3
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 30
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 36
Branch analysis from position: 37
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 56
Branch analysis from position: 45
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 53
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 66
Branch analysis from position: 66
Branch analysis from position: 63
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 7, Position 2 = 37
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
Branch analysis from position: 37
Branch analysis from position: 8
filename:       /in/6hVXG
function name:  (null)
number of ops:  68
compiled vars:  !0 = $price, !1 = $currencyCode, !2 = $price_tab
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 10
    4     1        ASSIGN                                                   !1, 'EUR'
    6     2      > SWITCH_STRING                                            !1, [ 'EUR':->8, 'CHF':->37, ], ->64
    7     3    >   IS_EQUAL                                                 !1, 'EUR'
          4      > JMPNZ                                                    ~5, ->8
   19     5    >   IS_EQUAL                                                 !1, 'CHF'
          6      > JMPNZ                                                    ~5, ->37
          7    > > JMP                                                      ->64
    8     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '.'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !2, $6
    9    13        COUNT                                            ~8      !2
         14        IS_EQUAL                                                 ~8, 2
         15      > JMPZ                                                     ~9, ->30
   10    16    >   FETCH_DIM_R                                      ~10     !2, 1
         17        IS_EQUAL                                                 ~10, '00'
         18      > JMPZ                                                     ~11, ->23
   11    19    >   FETCH_DIM_R                                      ~12     !2, 0
         20        CONCAT                                           ~13     ~12, '%E2%82%AC'
         21        ASSIGN                                                   !0, ~13
         22      > JMP                                                      ->29
   13    23    >   FETCH_DIM_R                                      ~15     !2, 0
         24        CONCAT                                           ~16     ~15, '%2C'
         25        FETCH_DIM_R                                      ~17     !2, 1
         26        CONCAT                                           ~18     ~16, ~17
         27        CONCAT                                           ~19     ~18, '%E2%82%AC'
         28        ASSIGN                                                   !0, ~19
         29    > > JMP                                                      ->36
   15    30    >   INIT_FCALL                                               'is_numeric'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $21     
         33      > JMPZ                                                     $21, ->36
   16    34    >   CONCAT                                           ~22     !0, '%E2%82%AC'
         35        ASSIGN                                                   !0, ~22
   18    36    > > JMP                                                      ->66
   20    37    >   INIT_FCALL                                               'explode'
         38        SEND_VAL                                                 '.'
         39        SEND_VAR                                                 !0
         40        DO_ICALL                                         $24     
         41        ASSIGN                                                   !2, $24
   21    42        COUNT                                            ~26     !2
         43        IS_EQUAL                                                 ~26, 2
         44      > JMPZ                                                     ~27, ->56
   22    45    >   FETCH_DIM_R                                      ~28     !2, 1
         46        IS_EQUAL                                                 ~28, '00'
         47      > JMPZ                                                     ~29, ->53
   23    48    >   FETCH_DIM_R                                      ~30     !2, 0
         49        CONCAT                                           ~31     'CHF+', ~30
         50        CONCAT                                           ~32     ~31, '.-'
         51        ASSIGN                                                   !0, ~32
         52      > JMP                                                      ->55
   25    53    >   CONCAT                                           ~34     'CHF+', !0
         54        ASSIGN                                                   !0, ~34
         55    > > JMP                                                      ->63
   27    56    >   INIT_FCALL                                               'is_numeric'
         57        SEND_VAR                                                 !0
         58        DO_ICALL                                         $36     
         59      > JMPZ                                                     $36, ->63
   28    60    >   CONCAT                                           ~37     'CHF+', !0
         61        CONCAT                                           ~38     ~37, '.-'
         62        ASSIGN                                                   !0, ~38
   30    63    > > JMP                                                      ->66
   32    64    > > RETURN                                                   !0
   33    65*       JMP                                                      ->66
   35    66    >   ECHO                                                     !0
   37    67      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.14 ms | 1404 KiB | 17 Q