3v4l.org

run code in 300+ PHP versions simultaneously
<?php $repl = [ '033' => 'FY', '101' => 'CY', '143' => 'AY', '147' => 'GG', '175' => 'CA' ]; $locationabbrev = '033-101-143-147-175'; $arr = explode("-", $locationabbrev); Foreach($arr as &$val){ $val= $repl[$val]; } $result = implode("-", $arr); Echo $result;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
2 jumps found. (Code = 126) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/iolal
function name:  (null)
number of ops:  20
compiled vars:  !0 = $repl, !1 = $locationabbrev, !2 = $arr, !3 = $val, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1        ASSIGN                                                   !1, '033-101-143-147-175'
   13     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '-'
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
   15     7      > FE_RESET_RW                                      $9      !2, ->12
          8    > > FE_FETCH_RW                                              $9, !3, ->12
   16     9    >   FETCH_DIM_R                                      ~10     !0, !3
         10        ASSIGN                                                   !3, ~10
   15    11      > JMP                                                      ->8
         12    >   FE_FREE                                                  $9
   19    13        INIT_FCALL                                               'implode'
         14        SEND_VAL                                                 '-'
         15        SEND_VAR                                                 !2
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !4, $12
   20    18        ECHO                                                     !4
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
256.4 ms | 1011 KiB | 15 Q