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 ) $newStr .= $string[$i]."</b>" ; } echo $newStr;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 11
Branch analysis from position: 37
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 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 11
Branch analysis from position: 37
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 = 43) Position 1 = 31, Position 2 = 34
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 11
Branch analysis from position: 37
Branch analysis from position: 11
Branch analysis from position: 34
Branch analysis from position: 30
Branch analysis from position: 20
Branch analysis from position: 16
filename:       /in/8kbaY
function name:  (null)
number of ops:  39
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                                                      ->35
    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                                                      ->34
   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                                                     ~21, ->34
   11    31    >   FETCH_DIM_R                                      ~23     !1, !4
         32        CONCAT                                           ~24     ~23, '%3C%2Fb%3E'
         33        ASSIGN_OP                                     8          !2, ~24
    7    34    >   PRE_INC                                                  !4
         35    >   IS_SMALLER                                               !4, !3
         36      > JMPNZ                                                    ~27, ->11
   14    37    >   ECHO                                                     !2
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.1 ms | 1400 KiB | 15 Q