3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dni = '342501198701065'; $row = str_split(strrev($dni)); $letters = array_combine(range(0,25), range('a', 'z')); //now just use: foreach($row as $n){ $dni_a[] = $letters[$n]; } $dni2 = implode($dni_a); echo $dni2;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 22, Position 2 = 27
Branch analysis from position: 22
2 jumps found. (Code = 78) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/AmWas
function name:  (null)
number of ops:  34
compiled vars:  !0 = $dni, !1 = $row, !2 = $letters, !3 = $n, !4 = $dni_a, !5 = $dni2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '342501198701065'
    4     1        INIT_FCALL                                               'str_split'
          2        INIT_FCALL                                               'strrev'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        SEND_VAR                                                 $7
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !1, $8
    6     8        INIT_FCALL                                               'array_combine'
          9        INIT_FCALL                                               'range'
         10        SEND_VAL                                                 0
         11        SEND_VAL                                                 25
         12        DO_ICALL                                         $10     
         13        SEND_VAR                                                 $10
         14        INIT_FCALL                                               'range'
         15        SEND_VAL                                                 'a'
         16        SEND_VAL                                                 'z'
         17        DO_ICALL                                         $11     
         18        SEND_VAR                                                 $11
         19        DO_ICALL                                         $12     
         20        ASSIGN                                                   !2, $12
    8    21      > FE_RESET_R                                       $14     !1, ->27
         22    > > FE_FETCH_R                                               $14, !3, ->27
    9    23    >   FETCH_DIM_R                                      ~16     !2, !3
         24        ASSIGN_DIM                                               !4
         25        OP_DATA                                                  ~16
    8    26      > JMP                                                      ->22
         27    >   FE_FREE                                                  $14
   11    28        INIT_FCALL                                               'implode'
         29        SEND_VAR                                                 !4
         30        DO_ICALL                                         $17     
         31        ASSIGN                                                   !5, $17
   12    32        ECHO                                                     !5
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
196.76 ms | 1396 KiB | 23 Q