3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'healing'; function matrix($input) { $inputIdx = str_split($input); $inputLen = strlen($input); for ($i = 0; $i < $inputLen; $i++) { for ($j = 0; $j < $inputLen; $j++) { $key = $i + $j; if (!array_key_exists($i+$j, $inputIdx)) { $key -= $inputLen; } echo $inputIdx[$key]; } echo PHP_EOL; } } matrix($str);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rHMGB
function name:  (null)
number of ops:  5
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'healing'
   23     1        INIT_FCALL                                               'matrix'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
          4      > RETURN                                                   1

Function matrix:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 9
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 11
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 9
Branch analysis from position: 27
Branch analysis from position: 9
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 11
Branch analysis from position: 23
Branch analysis from position: 11
Branch analysis from position: 18
filename:       /in/rHMGB
function name:  matrix
number of ops:  28
compiled vars:  !0 = $input, !1 = $inputIdx, !2 = $inputLen, !3 = $i, !4 = $j, !5 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'str_split'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    7     5        STRLEN                                           ~8      !0
          6        ASSIGN                                                   !2, ~8
    9     7        ASSIGN                                                   !3, 0
          8      > JMP                                                      ->25
   10     9    >   ASSIGN                                                   !4, 0
         10      > JMP                                                      ->21
   11    11    >   ADD                                              ~12     !3, !4
         12        ASSIGN                                                   !5, ~12
   13    13        ADD                                              ~14     !3, !4
         14        ARRAY_KEY_EXISTS                                 ~15     ~14, !1
         15        BOOL_NOT                                         ~16     ~15
         16      > JMPZ                                                     ~16, ->18
   14    17    >   ASSIGN_OP                                     2          !5, !2
   17    18    >   FETCH_DIM_R                                      ~18     !1, !5
         19        ECHO                                                     ~18
   10    20        PRE_INC                                                  !4
         21    >   IS_SMALLER                                               !4, !2
         22      > JMPNZ                                                    ~20, ->11
   19    23    >   ECHO                                                     '%0A'
    9    24        PRE_INC                                                  !3
         25    >   IS_SMALLER                                               !3, !2
         26      > JMPNZ                                                    ~22, ->9
   21    27    > > RETURN                                                   null

End of function matrix

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.46 ms | 1402 KiB | 16 Q