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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.1 ms | 1400 KiB | 15 Q