3v4l.org

run code in 300+ PHP versions simultaneously
<?php function htmlWrapThing($str, $size){ $html = false; $i = 0; $chars = str_split($str); $return = ""; $break = false; $tag = ""; foreach($chars as $char){ if($char=="<") $html = true; if($char==">") $html = false; if($html && $char!="/"){ $tag .= $char; } if(!$html) $i++; $return .= $char; if($i==$size) $break = true; if($char == " " && !$html && $break){ $return .= '</'.$tag.'>'."<br><br>".'<'.$tag.'>'; $i=0; $tag = ""; $break = false; } } return $return; } $str = "<p>hello world how is everyone doing today</p>"; echo htmlWrapThing($str,10);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hmF3q
function name:  (null)
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   ASSIGN                                                   !0, '%3Cp%3Ehello+world+how+is+everyone+doing+today%3C%2Fp%3E'
   32     1        INIT_FCALL                                               'htmlwrapthing'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 10
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Function htmlwrapthing:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 49
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 49
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 22
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 24
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
2 jumps found. (Code = 46) Position 1 = 33, Position 2 = 35
Branch analysis from position: 33
2 jumps found. (Code = 46) Position 1 = 36, Position 2 = 37
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 48
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 48
Branch analysis from position: 37
Branch analysis from position: 35
Branch analysis from position: 31
Branch analysis from position: 27
Branch analysis from position: 24
Branch analysis from position: 22
Branch analysis from position: 19
Branch analysis from position: 16
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
filename:       /in/hmF3q
function name:  htmlWrapThing
number of ops:  52
compiled vars:  !0 = $str, !1 = $size, !2 = $html, !3 = $i, !4 = $chars, !5 = $return, !6 = $break, !7 = $tag, !8 = $char
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        ASSIGN                                                   !2, <false>
    5     3        ASSIGN                                                   !3, 0
    6     4        INIT_FCALL                                               'str_split'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $11     
          7        ASSIGN                                                   !4, $11
    7     8        ASSIGN                                                   !5, ''
    8     9        ASSIGN                                                   !6, <false>
    9    10        ASSIGN                                                   !7, ''
   10    11      > FE_RESET_R                                       $16     !4, ->49
         12    > > FE_FETCH_R                                               $16, !8, ->49
   11    13    >   IS_EQUAL                                                 !8, '%3C'
         14      > JMPZ                                                     ~17, ->16
         15    >   ASSIGN                                                   !2, <true>
   12    16    >   IS_EQUAL                                                 !8, '%3E'
         17      > JMPZ                                                     ~19, ->19
         18    >   ASSIGN                                                   !2, <false>
   13    19    > > JMPZ_EX                                          ~21     !2, ->22
         20    >   IS_NOT_EQUAL                                     ~22     !8, '%2F'
         21        BOOL                                             ~21     ~22
         22    > > JMPZ                                                     ~21, ->24
   14    23    >   ASSIGN_OP                                     8          !7, !8
   17    24    >   BOOL_NOT                                         ~24     !2
         25      > JMPZ                                                     ~24, ->27
         26    >   PRE_INC                                                  !3
   18    27    >   ASSIGN_OP                                     8          !5, !8
   19    28        IS_EQUAL                                                 !3, !1
         29      > JMPZ                                                     ~27, ->31
         30    >   ASSIGN                                                   !6, <true>
   20    31    >   IS_EQUAL                                         ~29     !8, '+'
         32      > JMPZ_EX                                          ~29     ~29, ->35
         33    >   BOOL_NOT                                         ~30     !2
         34        BOOL                                             ~29     ~30
         35    > > JMPZ_EX                                          ~29     ~29, ->37
         36    >   BOOL                                             ~29     !6
         37    > > JMPZ                                                     ~29, ->48
   21    38    >   CONCAT                                           ~31     '%3C%2F', !7
         39        CONCAT                                           ~32     ~31, '%3E'
         40        CONCAT                                           ~33     ~32, '%3Cbr%3E%3Cbr%3E'
         41        CONCAT                                           ~34     ~33, '%3C'
         42        CONCAT                                           ~35     ~34, !7
         43        CONCAT                                           ~36     ~35, '%3E'
         44        ASSIGN_OP                                     8          !5, ~36
   22    45        ASSIGN                                                   !3, 0
   23    46        ASSIGN                                                   !7, ''
   24    47        ASSIGN                                                   !6, <false>
   10    48    > > JMP                                                      ->12
         49    >   FE_FREE                                                  $16
   27    50      > RETURN                                                   !5
   28    51*     > RETURN                                                   null

End of function htmlwrapthing

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.72 ms | 1403 KiB | 16 Q