3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = 43; $substitutes = range('a', 'j'); $formatted = sprintf('%010d', $number); $string = preg_replace_callback('.', function ($m) use ($substitutes) { return $substitutes[$m[0]]; }, $formatted); echo $string;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PqJB6
function name:  (null)
number of ops:  21
compiled vars:  !0 = $number, !1 = $substitutes, !2 = $formatted, !3 = $string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 43
    5     1        INIT_FCALL                                               'range'
          2        SEND_VAL                                                 'a'
          3        SEND_VAL                                                 'j'
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    6     6        INIT_FCALL                                               'sprintf'
          7        SEND_VAL                                                 '%25010d'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !2, $7
    7    11        INIT_FCALL                                               'preg_replace_callback'
         12        SEND_VAL                                                 '.'
         13        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FPqJB6%3A7%240'
         14        BIND_LEXICAL                                             ~9, !1
    9    15        SEND_VAL                                                 ~9
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $10     
    7    18        ASSIGN                                                   !3, $10
   11    19        ECHO                                                     !3
         20      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FPqJB6%3A7%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PqJB6
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $m, !1 = $substitutes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
    8     2        FETCH_DIM_R                                      ~2      !0, 0
          3        FETCH_DIM_R                                      ~3      !1, ~2
          4      > RETURN                                                   ~3
    9     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FPqJB6%3A7%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.13 ms | 1388 KiB | 19 Q