3v4l.org

run code in 500+ PHP versions simultaneously
<?php function HTMLStringify($arr, array $seen = array()) { if (is_array($arr)) { $seen[] = $arr; $html = '<ul>'; foreach ($arr as $key => $value) { $html .= '<li>' . $key; if (is_array($value)) { if (in_array($value, $seen, true)) { // Deal with recursion in your own way here $html .= ' [RECURSION]'; } else { $html .= HTMLStringify($value, $seen); } } elseif (is_numeric($value) || is_string($value) || is_null($value)) { $html .= ' = ' . $value; } else { $html .= ' [couldn\'t parse ' . gettype($value) . ']'; } $html .= '</li>'; } return $html . '</ul>'; } else { return null; } } $arr = array(1 => 'one', 2 => 'two'); $arr[3] = &$arr; echo HTMLStringify($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eRMBq
function name:  (null)
number of ops:  8
compiled vars:  !0 = $arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   34     0  E >   ASSIGN                                                       !0, <array>
   35     1        FETCH_DIM_W                                          $2      !0, 3
          2        ASSIGN_REF                                                   $2, !0
   36     3        INIT_FCALL                                                   'htmlstringify'
          4        SEND_VAR                                                     !0
          5        DO_FCALL                                          0  $4      
          6        ECHO                                                         $4
          7      > RETURN                                                       1

Function htmlstringify:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 46
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 42
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 42
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 25
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 25
2 jumps found. (Code = 47) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
2 jumps found. (Code = 47) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 36
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
Branch analysis from position: 36
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 32
Branch analysis from position: 29
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eRMBq
function name:  HTMLStringify
number of ops:  48
compiled vars:  !0 = $arr, !1 = $seen, !2 = $html, !3 = $value, !4 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   RECV                                                 !0      
          1        RECV_INIT                                            !1      <array>
    3     2        TYPE_CHECK                                      128          !0
          3      > JMPZ                                                         ~5, ->46
    4     4    >   ASSIGN_DIM                                                   !1
          5        OP_DATA                                                      !0
    5     6        ASSIGN                                                       !2, '%3Cul%3E'
    7     7      > FE_RESET_R                                           $8      !0, ->42
          8    > > FE_FETCH_R                                           ~9      $8, !3, ->42
          9    >   ASSIGN                                                       !4, ~9
    8    10        CONCAT                                               ~11     '%3Cli%3E', !4
         11        ASSIGN_OP                                         8          !2, ~11
   10    12        TYPE_CHECK                                      128          !3
         13      > JMPZ                                                         ~13, ->25
   12    14    >   FRAMELESS_ICALL_3                in_array            ~14     !3, !1
         15        OP_DATA                                                      <true>
         16      > JMPZ                                                         ~14, ->19
   14    17    >   ASSIGN_OP                                         8          !2, '+%5BRECURSION%5D'
   12    18      > JMP                                                          ->24
   16    19    >   INIT_FCALL_BY_NAME                                           'HTMLStringify'
         20        SEND_VAR_EX                                                  !3
         21        SEND_VAR_EX                                                  !1
         22        DO_FCALL                                          0  $16     
         23        ASSIGN_OP                                         8          !2, $16
   10    24    > > JMP                                                          ->40
   19    25    >   FRAMELESS_ICALL_1                is_numeric          ~18     !3
         26      > JMPNZ_EX                                             ~18     ~18, ->29
         27    >   TYPE_CHECK                                       64  ~19     !3
         28        BOOL                                                 ~18     ~19
         29    > > JMPNZ_EX                                             ~18     ~18, ->32
         30    >   TYPE_CHECK                                        2  ~20     !3
         31        BOOL                                                 ~18     ~20
         32    > > JMPZ                                                         ~18, ->36
   20    33    >   CONCAT                                               ~21     '+%3D+', !3
         34        ASSIGN_OP                                         8          !2, ~21
   19    35      > JMP                                                          ->40
   22    36    >   GET_TYPE                                             ~23     !3
         37        CONCAT                                               ~24     '+%5Bcouldn%27t+parse+', ~23
         38        CONCAT                                               ~25     ~24, '%5D'
         39        ASSIGN_OP                                         8          !2, ~25
   25    40    >   ASSIGN_OP                                         8          !2, '%3C%2Fli%3E'
    7    41      > JMP                                                          ->8
         42    >   FE_FREE                                                      $8
   28    43        CONCAT                                               ~28     !2, '%3C%2Ful%3E'
         44      > RETURN                                                       ~28
    3    45*       JMP                                                          ->47
   30    46    > > RETURN                                                       null
   32    47*     > RETURN                                                       null

End of function htmlstringify

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
278.58 ms | 3292 KiB | 18 Q