3v4l.org

run code in 300+ PHP versions simultaneously
<?php $id = '01110413'; $ltr = array('00' => 'A', '01' => 'B', '010' => 'X', '03' => 'C', '04' => 'D'); ksort($ltr); foreach ($ltr as $search=>$replace) { $id = str_replace($search, $replace, $id); } var_dump($id);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/5RZ6l
function name:  (null)
number of ops:  20
compiled vars:  !0 = $id, !1 = $ltr, !2 = $replace, !3 = $search
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '01110413'
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'ksort'
          3        SEND_REF                                                 !1
          4        DO_ICALL                                                 
    8     5      > FE_RESET_R                                       $7      !1, ->15
          6    > > FE_FETCH_R                                       ~8      $7, !2, ->15
          7    >   ASSIGN                                                   !3, ~8
    9     8        INIT_FCALL                                               'str_replace'
          9        SEND_VAR                                                 !3
         10        SEND_VAR                                                 !2
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !0, $10
    8    14      > JMP                                                      ->6
         15    >   FE_FREE                                                  $7
   12    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
204.35 ms | 1399 KiB | 19 Q