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

End of function htmlwrapthing

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.59 ms | 1403 KiB | 16 Q