3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sometext = "Some text **that is bold!** and some other text"; $string = explode('**', $sometext); $newstr = ''; $size = count($string); for ($i = 0; $i < $size; ++$i) { if (($i % 2 == 0 || $i == 0 )&& $i != $size-1 ) $newstr .= $string[$i]."<b>"; else if($i % 2 != 0 && $i != $size && $i != $size-1 ) $newstr .= $string[$i]."</b>" ; else if($i == $size-1) $newstr .= $string[$i]; } echo $newstr;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 45
Branch analysis from position: 45
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 11
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 47) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 11
Branch analysis from position: 47
Branch analysis from position: 11
Branch analysis from position: 25
2 jumps found. (Code = 46) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
2 jumps found. (Code = 46) Position 1 = 31, Position 2 = 34
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 39
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 39
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 44
Branch analysis from position: 42
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 11
Branch analysis from position: 47
Branch analysis from position: 11
Branch analysis from position: 44
Branch analysis from position: 34
Branch analysis from position: 30
Branch analysis from position: 20
Branch analysis from position: 16
filename:       /in/phVNr
function name:  (null)
number of ops:  49
compiled vars:  !0 = $sometext, !1 = $string, !2 = $newstr, !3 = $size, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Some+text+%2A%2Athat+is+bold%21%2A%2A+and+some+other+text'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2A%2A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    5     6        ASSIGN                                                   !2, ''
    6     7        COUNT                                            ~9      !1
          8        ASSIGN                                                   !3, ~9
    7     9        ASSIGN                                                   !4, 0
         10      > JMP                                                      ->45
    8    11    >   MOD                                              ~12     !4, 2
         12        IS_EQUAL                                         ~13     ~12, 0
         13      > JMPNZ_EX                                         ~13     ~13, ->16
         14    >   IS_EQUAL                                         ~14     !4, 0
         15        BOOL                                             ~13     ~14
         16    > > JMPZ_EX                                          ~13     ~13, ->20
         17    >   SUB                                              ~15     !3, 1
         18        IS_NOT_EQUAL                                     ~16     !4, ~15
         19        BOOL                                             ~13     ~16
         20    > > JMPZ                                                     ~13, ->25
    9    21    >   FETCH_DIM_R                                      ~17     !1, !4
         22        CONCAT                                           ~18     ~17, '%3Cb%3E'
         23        ASSIGN_OP                                     8          !2, ~18
         24      > JMP                                                      ->44
   10    25    >   MOD                                              ~20     !4, 2
         26        IS_NOT_EQUAL                                     ~21     ~20, 0
         27      > JMPZ_EX                                          ~21     ~21, ->30
         28    >   IS_NOT_EQUAL                                     ~22     !4, !3
         29        BOOL                                             ~21     ~22
         30    > > JMPZ_EX                                          ~21     ~21, ->34
         31    >   SUB                                              ~23     !3, 1
         32        IS_NOT_EQUAL                                     ~24     !4, ~23
         33        BOOL                                             ~21     ~24
         34    > > JMPZ                                                     ~21, ->39
   11    35    >   FETCH_DIM_R                                      ~25     !1, !4
         36        CONCAT                                           ~26     ~25, '%3C%2Fb%3E'
         37        ASSIGN_OP                                     8          !2, ~26
         38      > JMP                                                      ->44
   12    39    >   SUB                                              ~28     !3, 1
         40        IS_EQUAL                                                 !4, ~28
         41      > JMPZ                                                     ~29, ->44
   13    42    >   FETCH_DIM_R                                      ~30     !1, !4
         43        ASSIGN_OP                                     8          !2, ~30
    7    44    >   PRE_INC                                                  !4
         45    >   IS_SMALLER                                               !4, !3
         46      > JMPNZ                                                    ~33, ->11
   16    47    >   ECHO                                                     !2
         48      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.55 ms | 1400 KiB | 15 Q