3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.31 ms | 1388 KiB | 17 Q