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 ) $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 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 11
Branch analysis from position: 36
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 = 19
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 11
Branch analysis from position: 36
Branch analysis from position: 11
Branch analysis from position: 24
2 jumps found. (Code = 46) Position 1 = 27, Position 2 = 29
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 33
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 11
Branch analysis from position: 36
Branch analysis from position: 11
Branch analysis from position: 33
Branch analysis from position: 29
Branch analysis from position: 19
Branch analysis from position: 16
filename:       /in/T4JcK
function name:  (null)
number of ops:  38
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                                                      ->34
    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, ->19
         17    >   IS_NOT_EQUAL                                     ~15     !4, !3
         18        BOOL                                             ~13     ~15
         19    > > JMPZ                                                     ~13, ->24
    9    20    >   FETCH_DIM_R                                      ~16     !1, !4
         21        CONCAT                                           ~17     ~16, '%3Cb%3E'
         22        ASSIGN_OP                                     8          !2, ~17
         23      > JMP                                                      ->33
   10    24    >   MOD                                              ~19     !4, 2
         25        IS_NOT_EQUAL                                     ~20     ~19, 0
         26      > JMPZ_EX                                          ~20     ~20, ->29
         27    >   IS_NOT_EQUAL                                     ~21     !4, !3
         28        BOOL                                             ~20     ~21
         29    > > JMPZ                                                     ~20, ->33
   11    30    >   FETCH_DIM_R                                      ~22     !1, !4
         31        CONCAT                                           ~23     ~22, '%3C%2Fb%3E'
         32        ASSIGN_OP                                     8          !2, ~23
    7    33    >   PRE_INC                                                  !4
         34    >   IS_SMALLER                                               !4, !3
         35      > JMPNZ                                                    ~26, ->11
   14    36    >   ECHO                                                     !2
         37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.82 ms | 1400 KiB | 15 Q