3v4l.org

run code in 300+ PHP versions simultaneously
<?php $size=8; $path=[]; function danger($a,$b){ for($i=0;$i<count($path);$i++){ if($i==$a) return TRUE; elseif($path[i]==$b) return TRUE; elseif($i==$path[i]&&$a==$b) return TRUE; } return FALSE; } function move($row){ if($row>$size){ for($i=0;$i<count($path);$i++){ echo $path[i],' '; } echo '<br/>'; } else{ for($i=0;$i<size;$i++){ if(!danger($row,$i)){ $path[$row-1]=$i; move($row+1); } } } } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QHDRV
function name:  (null)
number of ops:  3
compiled vars:  !0 = $size, !1 = $path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 8
    3     1        ASSIGN                                                   !1, <array>
   29     2      > RETURN                                                   1

Function danger:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 4
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 14
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 4
Branch analysis from position: 26
Branch analysis from position: 4
Branch analysis from position: 20
filename:       /in/QHDRV
function name:  danger
number of ops:  28
compiled vars:  !0 = $a, !1 = $b, !2 = $i, !3 = $path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->23
    6     4    >   IS_EQUAL                                                 !2, !0
          5      > JMPZ                                                     ~5, ->8
          6    > > RETURN                                                   <true>
          7*       JMP                                                      ->22
    7     8    >   FETCH_CONSTANT                                   ~6      'i'
          9        FETCH_DIM_R                                      ~7      !3, ~6
         10        IS_EQUAL                                                 !1, ~7
         11      > JMPZ                                                     ~8, ->14
         12    > > RETURN                                                   <true>
         13*       JMP                                                      ->22
    8    14    >   FETCH_CONSTANT                                   ~9      'i'
         15        FETCH_DIM_R                                      ~10     !3, ~9
         16        IS_EQUAL                                         ~11     !2, ~10
         17      > JMPZ_EX                                          ~11     ~11, ->20
         18    >   IS_EQUAL                                         ~12     !0, !1
         19        BOOL                                             ~11     ~12
         20    > > JMPZ                                                     ~11, ->22
         21    > > RETURN                                                   <true>
    5    22    >   PRE_INC                                                  !2
         23    >   COUNT                                            ~14     !3
         24        IS_SMALLER                                               !2, ~14
         25      > JMPNZ                                                    ~15, ->4
   10    26    > > RETURN                                                   <false>
   11    27*     > RETURN                                                   null

End of function danger

Function move:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 15
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 5
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 5
Branch analysis from position: 13
Branch analysis from position: 5
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 17
Branch analysis from position: 34
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 30
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 17
Branch analysis from position: 34
Branch analysis from position: 17
Branch analysis from position: 30
filename:       /in/QHDRV
function name:  move
number of ops:  35
compiled vars:  !0 = $row, !1 = $size, !2 = $i, !3 = $path
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
   13     1        IS_SMALLER                                               !1, !0
          2      > JMPZ                                                     ~4, ->15
   14     3    >   ASSIGN                                                   !2, 0
          4      > JMP                                                      ->10
   15     5    >   FETCH_CONSTANT                                   ~6      'i'
          6        FETCH_DIM_R                                      ~7      !3, ~6
          7        ECHO                                                     ~7
          8        ECHO                                                     '+'
   14     9        PRE_INC                                                  !2
         10    >   COUNT                                            ~9      !3
         11        IS_SMALLER                                               !2, ~9
         12      > JMPNZ                                                    ~10, ->5
   17    13    >   ECHO                                                     '%3Cbr%2F%3E'
         14      > JMP                                                      ->34
   20    15    >   ASSIGN                                                   !2, 0
         16      > JMP                                                      ->31
   21    17    >   INIT_FCALL                                               'danger'
         18        SEND_VAR                                                 !0
         19        SEND_VAR                                                 !2
         20        DO_FCALL                                      0  $12     
         21        BOOL_NOT                                         ~13     $12
         22      > JMPZ                                                     ~13, ->30
   22    23    >   SUB                                              ~14     !0, 1
         24        ASSIGN_DIM                                               !3, ~14
         25        OP_DATA                                                  !2
   23    26        INIT_FCALL_BY_NAME                                       'move'
         27        ADD                                              ~16     !0, 1
         28        SEND_VAL_EX                                              ~16
         29        DO_FCALL                                      0          
   20    30    >   PRE_INC                                                  !2
         31    >   FETCH_CONSTANT                                   ~19     'size'
         32        IS_SMALLER                                               !2, ~19
         33      > JMPNZ                                                    ~20, ->17
   28    34    > > RETURN                                                   null

End of function move

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.38 ms | 1407 KiB | 14 Q