3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings = [ "test string", "lado lomidze needs a solution", "i made some research and found 'good' answers here; they really helped me." ]; // if not already all lowercase, use strtolower() foreach ($strings as &$string) { for ($i = 0, $len = strlen($string); $i < $len; $i += 2) { $string[$i] = strtoupper($string[$i]); } } var_export($strings);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 7
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 7
Branch analysis from position: 16
Branch analysis from position: 7
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/dAu0W
function name:  (null)
number of ops:  22
compiled vars:  !0 = $strings, !1 = $string, !2 = $i, !3 = $len
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    8     1      > FE_RESET_RW                                      $5      !0, ->17
          2    > > FE_FETCH_RW                                              $5, !1, ->17
    9     3    >   ASSIGN                                                   !2, 0
          4        STRLEN                                           ~7      !1
          5        ASSIGN                                                   !3, ~7
          6      > JMP                                                      ->14
   10     7    >   INIT_FCALL                                               'strtoupper'
          8        FETCH_DIM_R                                      ~10     !1, !2
          9        SEND_VAL                                                 ~10
         10        DO_ICALL                                         $11     
         11        ASSIGN_DIM                                               !1, !2
         12        OP_DATA                                                  $11
    9    13        ASSIGN_OP                                     1          !2, 2
         14    >   IS_SMALLER                                               !2, !3
         15      > JMPNZ                                                    ~13, ->7
    8    16    > > JMP                                                      ->2
         17    >   FE_FREE                                                  $5
   13    18        INIT_FCALL                                               'var_export'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.77 ms | 999 KiB | 15 Q