3v4l.org

run code in 300+ PHP versions simultaneously
<?php header('content-type:text/plain'); function HTMLStringify($arr, $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)) { $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>'; } $html .= '</ul>'; return $html; } 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/asHlA
function name:  (null)
number of ops:  11
compiled vars:  !0 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'header'
          1        SEND_VAL                                                 'content-type%3Atext%2Fplain'
          2        DO_ICALL                                                 
   46     3        ASSIGN                                                   !0, <array>
   47     4        FETCH_DIM_W                                      $3      !0, 3
          5        ASSIGN_REF                                               $3, !0
   48     6        INIT_FCALL                                               'htmlstringify'
          7        SEND_VAR                                                 !0
          8        DO_FCALL                                      0  $5      
          9        ECHO                                                     $5
         10      > 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 = 125) Position 1 = 8, Position 2 = 47
Branch analysis from position: 8
2 jumps found. (Code = 126) 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/asHlA
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
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      <array>
    6     2        TYPE_CHECK                                  128          !0
          3      > JMPZ                                                     ~5, ->51
    7     4    >   FETCH_DIM_W                                      $6      !1
          5        ASSIGN_REF                                               $6, !0
    8     6        ASSIGN                                                   !2, '%3Cul%3E'
   10     7      > FE_RESET_RW                                      $9      !0, ->47
          8    > > FE_FETCH_RW                                      ~10     $9, !3, ->47
          9    >   ASSIGN                                                   !4, ~10
   12    10        CONCAT                                           ~12     '%3Cli%3E', !4
         11        ASSIGN_OP                                     8          !2, ~12
   14    12        TYPE_CHECK                                  128          !3
         13      > JMPZ                                                     ~14, ->28
   16    14    >   INIT_FCALL                                               'in_array'
         15        SEND_VAR                                                 !3
         16        SEND_VAR                                                 !1
         17        SEND_VAL                                                 <true>
         18        DO_ICALL                                         $15     
         19      > JMPZ                                                     $15, ->22
   18    20    >   ASSIGN_OP                                     8          !2, '%2ARECURSION%2A'
         21      > JMP                                                      ->27
   22    22    >   INIT_FCALL_BY_NAME                                       'HTMLStringify'
         23        SEND_VAR_EX                                              !3
         24        SEND_VAR_EX                                              !1
         25        DO_FCALL                                      0  $17     
         26        ASSIGN_OP                                     8          !2, $17
         27    > > JMP                                                      ->45
   25    28    >   INIT_FCALL                                               'is_numeric'
         29        SEND_VAR                                                 !3
         30        DO_ICALL                                         $19     
         31      > JMPNZ_EX                                         ~20     $19, ->34
         32    >   TYPE_CHECK                                   64  ~21     !3
         33        BOOL                                             ~20     ~21
         34    > > JMPNZ_EX                                         ~20     ~20, ->37
         35    >   TYPE_CHECK                                    2  ~22     !3
         36        BOOL                                             ~20     ~22
         37    > > JMPZ                                                     ~20, ->41
   27    38    >   CONCAT                                           ~23     '+%3D+', !3
         39        ASSIGN_OP                                     8          !2, ~23
         40      > JMP                                                      ->45
   31    41    >   GET_TYPE                                         ~25     !3
         42        CONCAT                                           ~26     '+%5Bcouldn%27t+parse+', ~25
         43        CONCAT                                           ~27     ~26, '%5D'
         44        ASSIGN_OP                                     8          !2, ~27
   34    45    >   ASSIGN_OP                                     8          !2, '%3C%2Fli%3E'
   10    46      > JMP                                                      ->8
         47    >   FE_FREE                                                  $9
   37    48        ASSIGN_OP                                     8          !2, '%3C%2Ful%3E'
   38    49      > RETURN                                                   !2
         50*       JMP                                                      ->52
   42    51    > > RETURN                                                   null
   44    52*     > RETURN                                                   null

End of function htmlstringify

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.54 ms | 1403 KiB | 20 Q