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]; } $s = preg_replace( '/\*\*(.+?)\*\*/isU', '<b>$1</b>', $sometext); echo $s; echo "\n".$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/GB7eO
function name:  (null)
number of ops:  57
compiled vars:  !0 = $sometext, !1 = $string, !2 = $newstr, !3 = $size, !4 = $i, !5 = $s
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%2A%2A%2A%2A'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%2A%2A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
    5     6        ASSIGN                                                   !2, ''
    6     7        COUNT                                            ~10     !1
          8        ASSIGN                                                   !3, ~10
    7     9        ASSIGN                                                   !4, 0
         10      > JMP                                                      ->45
    8    11    >   MOD                                              ~13     !4, 2
         12        IS_EQUAL                                         ~14     ~13, 0
         13      > JMPNZ_EX                                         ~14     ~14, ->16
         14    >   IS_EQUAL                                         ~15     !4, 0
         15        BOOL                                             ~14     ~15
         16    > > JMPZ_EX                                          ~14     ~14, ->20
         17    >   SUB                                              ~16     !3, 1
         18        IS_NOT_EQUAL                                     ~17     !4, ~16
         19        BOOL                                             ~14     ~17
         20    > > JMPZ                                                     ~14, ->25
    9    21    >   FETCH_DIM_R                                      ~18     !1, !4
         22        CONCAT                                           ~19     ~18, '%3Cb%3E'
         23        ASSIGN_OP                                     8          !2, ~19
         24      > JMP                                                      ->44
   10    25    >   MOD                                              ~21     !4, 2
         26        IS_NOT_EQUAL                                     ~22     ~21, 0
         27      > JMPZ_EX                                          ~22     ~22, ->30
         28    >   IS_NOT_EQUAL                                     ~23     !4, !3
         29        BOOL                                             ~22     ~23
         30    > > JMPZ_EX                                          ~22     ~22, ->34
         31    >   SUB                                              ~24     !3, 1
         32        IS_NOT_EQUAL                                     ~25     !4, ~24
         33        BOOL                                             ~22     ~25
         34    > > JMPZ                                                     ~22, ->39
   11    35    >   FETCH_DIM_R                                      ~26     !1, !4
         36        CONCAT                                           ~27     ~26, '%3C%2Fb%3E'
         37        ASSIGN_OP                                     8          !2, ~27
         38      > JMP                                                      ->44
   12    39    >   SUB                                              ~29     !3, 1
         40        IS_EQUAL                                                 !4, ~29
         41      > JMPZ                                                     ~30, ->44
   13    42    >   FETCH_DIM_R                                      ~31     !1, !4
         43        ASSIGN_OP                                     8          !2, ~31
    7    44    >   PRE_INC                                                  !4
         45    >   IS_SMALLER                                               !4, !3
         46      > JMPNZ                                                    ~34, ->11
   16    47    >   INIT_FCALL                                               'preg_replace'
   17    48        SEND_VAL                                                 '%2F%5C%2A%5C%2A%28.%2B%3F%29%5C%2A%5C%2A%2FisU'
   18    49        SEND_VAL                                                 '%3Cb%3E%241%3C%2Fb%3E'
   19    50        SEND_VAR                                                 !0
         51        DO_ICALL                                         $35     
   16    52        ASSIGN                                                   !5, $35
   21    53        ECHO                                                     !5
   22    54        CONCAT                                           ~37     '%0A', !2
         55        ECHO                                                     ~37
         56      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.57 ms | 1400 KiB | 17 Q