3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "I am a boy"; $reversed = ""; $tmp = ""; for($i = 0; $i < strlen($string); $i++) { if($string[$i] == " ") { $reversed .= $tmp . " "; $tmp = ""; continue; } $tmp = $string[$i] . $tmp; echo $temp.PHP_EOL; } $reversed .= $tmp; echo $reversed;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 5
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 5
Branch analysis from position: 21
Branch analysis from position: 5
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 5
Branch analysis from position: 21
Branch analysis from position: 5
filename:       /in/aMAIn
function name:  (null)
number of ops:  24
compiled vars:  !0 = $string, !1 = $reversed, !2 = $tmp, !3 = $i, !4 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'I+am+a+boy'
    5     1        ASSIGN                                                   !1, ''
    6     2        ASSIGN                                                   !2, ''
    7     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->18
    8     5    >   FETCH_DIM_R                                      ~9      !0, !3
          6        IS_EQUAL                                                 ~9, '+'
          7      > JMPZ                                                     ~10, ->12
    9     8    >   CONCAT                                           ~11     !2, '+'
          9        ASSIGN_OP                                     8          !1, ~11
   10    10        ASSIGN                                                   !2, ''
   11    11      > JMP                                                      ->17
   13    12    >   FETCH_DIM_R                                      ~14     !0, !3
         13        CONCAT                                           ~15     ~14, !2
         14        ASSIGN                                                   !2, ~15
   14    15        CONCAT                                           ~17     !4, '%0A'
         16        ECHO                                                     ~17
    7    17    >   PRE_INC                                                  !3
         18    >   STRLEN                                           ~19     !0
         19        IS_SMALLER                                               !3, ~19
         20      > JMPNZ                                                    ~20, ->5
   16    21    >   ASSIGN_OP                                     8          !1, !2
   18    22        ECHO                                                     !1
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.49 ms | 1395 KiB | 13 Q