3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "I am a boy like desired and expected"; $result = ''; $reversedWord = ''; $length = strlen($string); for ($offset = 0; $offset < $length; ++$offset) { if ($string[$offset] === ' ') { $result .= $reversedWord . ' '; $reversedWord = ''; } else { $reversedWord = $string[$offset] . $reversedWord; } } $result .= $reversedWord; echo $result;
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 = 20, Position 2 = 7
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 7
Branch analysis from position: 20
Branch analysis from position: 7
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 7
Branch analysis from position: 20
Branch analysis from position: 7
filename:       /in/ZJBbj
function name:  (null)
number of ops:  23
compiled vars:  !0 = $string, !1 = $result, !2 = $reversedWord, !3 = $length, !4 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'I+am+a+boy+like+desired+and+expected'
    5     1        ASSIGN                                                   !1, ''
    6     2        ASSIGN                                                   !2, ''
    7     3        STRLEN                                           ~8      !0
          4        ASSIGN                                                   !3, ~8
    8     5        ASSIGN                                                   !4, 0
          6      > JMP                                                      ->18
    9     7    >   FETCH_DIM_R                                      ~11     !0, !4
          8        IS_IDENTICAL                                             ~11, '+'
          9      > JMPZ                                                     ~12, ->14
   10    10    >   CONCAT                                           ~13     !2, '+'
         11        ASSIGN_OP                                     8          !1, ~13
   11    12        ASSIGN                                                   !2, ''
    9    13      > JMP                                                      ->17
   13    14    >   FETCH_DIM_R                                      ~16     !0, !4
         15        CONCAT                                           ~17     ~16, !2
         16        ASSIGN                                                   !2, ~17
    8    17    >   PRE_INC                                                  !4
         18    >   IS_SMALLER                                               !4, !3
         19      > JMPNZ                                                    ~20, ->7
   16    20    >   ASSIGN_OP                                     8          !1, !2
   18    21        ECHO                                                     !1
   19    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.17 ms | 999 KiB | 13 Q