3v4l.org

run code in 300+ PHP versions simultaneously
<?php $substituir = array('MEC','AUT','SED','F.POWER','ECONOFLEX','COMF','T.FLEX','T. FLEX','TOT.FLEX','T. FIELD','TIPTRON','I MOTION','TIPTR','STRONIC','SEDÃ','C.STYLE','C.PLUS','C./','AVANTGARD','AVANGARDE','CUPÊ','CUPÉ','COUPÊ','RANGE R.EVOQUE','DISCOVERY4','FREELANDER2','FURG\\.','MEC\\.','AUT\\.','EXEC\\.','CONV\\.','SED\\.','INTERC.','EXPRES\\.','CLASS\\.','HAT\\.','PREM\\.','POW\\.','FLEXP\\.','ADVANT\\.','ECONOF\\.','EXPRES\\.','TIP\\.','COMF\\.','HIGHLI\\.','LUG\\.','EXCLUS\\.','EXCL\\.','LIMIT\\.','ELEG\\.','KOMP\\.','TOUR\\.','EXECUT\\.','EVOL\\.','EVOLUT\\.','INT.','BLIND\\.','INTERC\\.','SED\\.','PRIV\\.','EXPRES\\.','EXP\\.','RANGE R\\.'); $novo = array('MANUAL','AUTOMÁTICO','SEDAN','FLEXPOWER','ECONO.FLEX','COMFORTLINE','TOTAL FLEX','TOTAL FLEX','TOTAL FLEX','TRACK & FIELD','TIPTRONIC','I-MOTION','TIPTRONIC','S-TRONIC','SEDAN','COMFORT SYTLE','COMFORT PLUS','COMFORT','AVANTGARDE','AVANTGARDE','COUPÉ','COUPÉ','COUPÉ','RANGE ROVER EVOQUE','DISCOVERY 4','FREELANDER 2','FURGÃO','MANUAL','AUTOMÁTICO','EXECUTIVE','CONVERSÍVEL','SEDAN','INTERCOOLER','EXPRESSION','CLASSIC','HATCH','PREMIUM','POWER','FLEXPOWER','ADVANTAGE','ECONO.FLEX','EXPRESSION','TIPTRONIC','COMFORTLINE','HIGHLINE','LUGARES','EXCLUSIVE','EXCLUSIVE','LIMITED','ELEGANCE','KOMPRESSOR','TOURING','EXECUTIVE','EVOLUTION','EVOLUTION','INTERCOOLER','BLINDADO','INTERCOOLER','SEDAN','PRIVILÈGE','EXPRESSION','EXPRESSION','RANGE ROVER'); for($i = 0; $i <count($substituir); $i++){ if(strpos($substituir[$i],".")) { $substituir[$i] = '#' . $substituir[$i] . '#i'; echo substr($substituir[$i],-1); } else { $substituir[$i] = '#\b(' . $substituir[$i] . ')\b#i'; } } echo preg_replace($substituir,$novo,'CELTA SPIRIT/ LT 1.0 MPFI 8V FLEXP. 5p');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 4
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 22
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 4
Branch analysis from position: 31
Branch analysis from position: 4
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 31, Position 2 = 4
Branch analysis from position: 31
Branch analysis from position: 4
filename:       /in/HH0WT
function name:  (null)
number of ops:  38
compiled vars:  !0 = $substituir, !1 = $novo, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->28
    7     4    >   INIT_FCALL                                               'strpos'
          5        FETCH_DIM_R                                      ~6      !0, !2
          6        SEND_VAL                                                 ~6
          7        SEND_VAL                                                 '.'
          8        DO_ICALL                                         $7      
          9      > JMPZ                                                     $7, ->22
    9    10    >   FETCH_DIM_R                                      ~9      !0, !2
         11        CONCAT                                           ~10     '%23', ~9
         12        CONCAT                                           ~11     ~10, '%23i'
         13        ASSIGN_DIM                                               !0, !2
         14        OP_DATA                                                  ~11
   10    15        INIT_FCALL                                               'substr'
         16        FETCH_DIM_R                                      ~12     !0, !2
         17        SEND_VAL                                                 ~12
         18        SEND_VAL                                                 -1
         19        DO_ICALL                                         $13     
         20        ECHO                                                     $13
         21      > JMP                                                      ->27
   12    22    >   FETCH_DIM_R                                      ~15     !0, !2
         23        CONCAT                                           ~16     '%23%5Cb%28', ~15
         24        CONCAT                                           ~17     ~16, '%29%5Cb%23i'
         25        ASSIGN_DIM                                               !0, !2
         26        OP_DATA                                                  ~17
    6    27    >   PRE_INC                                                  !2
         28    >   COUNT                                            ~19     !0
         29        IS_SMALLER                                               !2, ~19
         30      > JMPNZ                                                    ~20, ->4
   16    31    >   INIT_FCALL                                               'preg_replace'
         32        SEND_VAR                                                 !0
         33        SEND_VAR                                                 !1
         34        SEND_VAL                                                 'CELTA+SPIRIT%2F+LT+1.0+MPFI+8V+FLEXP.+5p'
         35        DO_ICALL                                         $21     
         36        ECHO                                                     $21
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.26 ms | 1400 KiB | 19 Q