3v4l.org

run code in 300+ PHP versions simultaneously
<?php function parseX($string) { $array = is_string($string) ? str_split($string) : $string; if (!in_array("X" , $array)) { return [$string]; } $ret = []; $key = array_search('X' , $array); for($i = 0 ; $i < 10; $i++) { $array[$key] = $i; $ret = array_merge($ret , parseX(implode('' , $array))); } return $ret; } var_dump(parseX("XX"));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WuGsi
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'parsex'
          2        SEND_VAL                                                 'XX'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function parsex:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 41
Branch analysis from position: 41
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 26
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 26
Branch analysis from position: 43
Branch analysis from position: 26
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
Branch analysis from position: 18
filename:       /in/WuGsi
function name:  parseX
number of ops:  45
compiled vars:  !0 = $string, !1 = $array, !2 = $ret, !3 = $key, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        TYPE_CHECK                                   64          !0
          2      > JMPZ                                                     ~5, ->8
          3    >   INIT_FCALL                                               'str_split'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $6      
          6        QM_ASSIGN                                        ~7      $6
          7      > JMP                                                      ->9
          8    >   QM_ASSIGN                                        ~7      !0
          9    >   ASSIGN                                                   !1, ~7
    7    10        INIT_FCALL                                               'in_array'
         11        SEND_VAL                                                 'X'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                         $9      
         14        BOOL_NOT                                         ~10     $9
         15      > JMPZ                                                     ~10, ->18
    9    16    >   INIT_ARRAY                                       ~11     !0
         17      > RETURN                                                   ~11
   12    18    >   ASSIGN                                                   !2, <array>
   13    19        INIT_FCALL                                               'array_search'
         20        SEND_VAL                                                 'X'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                         $13     
         23        ASSIGN                                                   !3, $13
   15    24        ASSIGN                                                   !4, 0
         25      > JMP                                                      ->41
   17    26    >   ASSIGN_DIM                                               !1, !3
         27        OP_DATA                                                  !4
   18    28        INIT_FCALL                                               'array_merge'
         29        SEND_VAR                                                 !2
         30        INIT_FCALL_BY_NAME                                       'parseX'
         31        INIT_FCALL                                               'implode'
         32        SEND_VAL                                                 ''
         33        SEND_VAR                                                 !1
         34        DO_ICALL                                         $17     
         35        SEND_VAR_NO_REF_EX                                       $17
         36        DO_FCALL                                      0  $18     
         37        SEND_VAR                                                 $18
         38        DO_ICALL                                         $19     
         39        ASSIGN                                                   !2, $19
   15    40        PRE_INC                                                  !4
         41    >   IS_SMALLER                                               !4, 10
         42      > JMPNZ                                                    ~22, ->26
   21    43    > > RETURN                                                   !2
   22    44*     > RETURN                                                   null

End of function parsex

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.78 ms | 1403 KiB | 26 Q