3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '_10_1_18_4_9_14_ _'; $letters = str_repeat('A', substr_count($str, '_')); $limit = 100; for ($i = 0; $i < $limit; $i++) { echo interpolate($str, str_split($letters)), PHP_EOL; $letters++; } function interpolate($str, $letters) { while (($pos = strpos($str, '_')) !== false) { $str[$pos] = array_shift($letters); } return $str; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 13
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 13
Branch analysis from position: 26
Branch analysis from position: 13
filename:       /in/GAEJN
function name:  (null)
number of ops:  27
compiled vars:  !0 = $str, !1 = $letters, !2 = $limit, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '_10_1_18_4_9_14_+_'
    3     1        INIT_FCALL                                               'str_repeat'
          2        SEND_VAL                                                 'A'
          3        INIT_FCALL                                               'substr_count'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 '_'
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !1, $6
    5    10        ASSIGN                                                   !2, 100
    7    11        ASSIGN                                                   !3, 0
         12      > JMP                                                      ->24
    8    13    >   INIT_FCALL_BY_NAME                                       'interpolate'
         14        SEND_VAR_EX                                              !0
         15        INIT_FCALL                                               'str_split'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                         $10     
         18        SEND_VAR_NO_REF_EX                                       $10
         19        DO_FCALL                                      0  $11     
         20        ECHO                                                     $11
         21        ECHO                                                     '%0A'
    9    22        PRE_INC                                                  !1
    7    23        PRE_INC                                                  !3
         24    >   IS_SMALLER                                               !3, !2
         25      > JMPNZ                                                    ~14, ->13
   18    26    > > RETURN                                                   1

Function interpolate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 3
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 44) Position 1 = 15, Position 2 = 3
Branch analysis from position: 15
Branch analysis from position: 3
filename:       /in/GAEJN
function name:  interpolate
number of ops:  17
compiled vars:  !0 = $str, !1 = $letters, !2 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2      > JMP                                                      ->8
   14     3    >   INIT_FCALL                                               'array_shift'
          4        SEND_REF                                                 !1
          5        DO_ICALL                                         $4      
          6        ASSIGN_DIM                                               !0, !2
          7        OP_DATA                                                  $4
   13     8    >   INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 '_'
         11        DO_ICALL                                         $5      
         12        ASSIGN                                           ~6      !2, $5
         13        TYPE_CHECK                                  1018          ~6
         14      > JMPNZ                                                    ~7, ->3
   17    15    > > RETURN                                                   !0
   18    16*     > RETURN                                                   null

End of function interpolate

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.87 ms | 1400 KiB | 23 Q