3v4l.org

run code in 300+ 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 = 51
Branch analysis from position: 4
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 47
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 47
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 28
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 28
2 jumps found. (Code = 47) Position 1 = 32, Position 2 = 34
Branch analysis from position: 32
2 jumps found. (Code = 47) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 41
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 37
Branch analysis from position: 34
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 47
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eRMBq
function name:  HTMLStringify
number of ops:  53
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, ->51
    4     4    >   ASSIGN_DIM                                               !1
          5        OP_DATA                                                  !0
    5     6        ASSIGN                                                   !2, '%3Cul%3E'
    7     7      > FE_RESET_R                                       $8      !0, ->47
          8    > > FE_FETCH_R                                       ~9      $8, !3, ->47
          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, ->28
   12    14    >   INIT_FCALL                                               'in_array'
         15        SEND_VAR                                                 !3
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $14     
         19      > JMPZ                                                     $14, ->22
   14    20    >   ASSIGN_OP                                     8          !2, '+%5BRECURSION%5D'
   12    21      > JMP                                                      ->27
   16    22    >   INIT_FCALL_BY_NAME                                       'HTMLStringify'
         23        SEND_VAR_EX                                              !3
         24        SEND_VAR_EX                                              !1
         25        DO_FCALL                                      0  $16     
         26        ASSIGN_OP                                     8          !2, $16
   10    27    > > JMP                                                      ->45
   19    28    >   INIT_FCALL                                               'is_numeric'
         29        SEND_VAR                                                 !3
         30        DO_ICALL                                         $18     
         31      > JMPNZ_EX                                         ~19     $18, ->34
         32    >   TYPE_CHECK                                   64  ~20     !3
         33        BOOL                                             ~19     ~20
         34    > > JMPNZ_EX                                         ~19     ~19, ->37
         35    >   TYPE_CHECK                                    2  ~21     !3
         36        BOOL                                             ~19     ~21
         37    > > JMPZ                                                     ~19, ->41
   20    38    >   CONCAT                                           ~22     '+%3D+', !3
         39        ASSIGN_OP                                     8          !2, ~22
   19    40      > JMP                                                      ->45
   22    41    >   GET_TYPE                                         ~24     !3
         42        CONCAT                                           ~25     '+%5Bcouldn%27t+parse+', ~24
         43        CONCAT                                           ~26     ~25, '%5D'
         44        ASSIGN_OP                                     8          !2, ~26
   25    45    >   ASSIGN_OP                                     8          !2, '%3C%2Fli%3E'
    7    46      > JMP                                                      ->8
         47    >   FE_FREE                                                  $8
   28    48        CONCAT                                           ~29     !2, '%3C%2Ful%3E'
         49      > RETURN                                                   ~29
    3    50*       JMP                                                      ->52
   30    51    > > RETURN                                                   null
   32    52*     > RETURN                                                   null

End of function htmlstringify

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.41 ms | 1445 KiB | 16 Q