3v4l.org

run code in 300+ PHP versions simultaneously
<?php function reverseString($string) { $l = strlen($string) - 1; for($i = 0, $j = $l, $e = $l / 2; $i < $e; $i++, $j--) { $string[$i] ^= $string[$j]; $string[$j] ^= $string[$i]; $string[$i] ^= $string[$j]; } return $string; } echo reverseString('fooooooooo');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y6pDL
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'reversestring'
          1        SEND_VAL                                                 'fooooooooo'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function reversestring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 9
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 22, Position 2 = 9
Branch analysis from position: 22
Branch analysis from position: 9
filename:       /in/Y6pDL
function name:  reverseString
number of ops:  24
compiled vars:  !0 = $string, !1 = $l, !2 = $i, !3 = $j, !4 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        STRLEN                                           ~5      !0
          2        SUB                                              ~6      ~5, 1
          3        ASSIGN                                                   !1, ~6
    6     4        ASSIGN                                                   !2, 0
          5        ASSIGN                                                   !3, !1
          6        DIV                                              ~10     !1, 2
          7        ASSIGN                                                   !4, ~10
          8      > JMP                                                      ->20
    8     9    >   FETCH_DIM_R                                      ~13     !0, !3
         10        ASSIGN_DIM_OP                ^=              11          !0, !2
         11        OP_DATA                                                  ~13
    9    12        FETCH_DIM_R                                      ~15     !0, !2
         13        ASSIGN_DIM_OP                ^=              11          !0, !3
         14        OP_DATA                                                  ~15
   10    15        FETCH_DIM_R                                      ~17     !0, !3
         16        ASSIGN_DIM_OP                ^=              11          !0, !2
         17        OP_DATA                                                  ~17
    6    18        PRE_INC                                                  !2
         19        PRE_DEC                                                  !3
         20    >   IS_SMALLER                                               !2, !4
         21      > JMPNZ                                                    ~20, ->9
   12    22    > > RETURN                                                   !0
   13    23*     > RETURN                                                   null

End of function reversestring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.49 ms | 1399 KiB | 14 Q