3v4l.org

run code in 300+ PHP versions simultaneously
<?php function reverseString($string) { $l = strlen($string)-1; for($i=0; $i<$l/2; $i++) { $string[$i] = $string[$i] ^ $string[$l-$i]; $string[$l-$i] = $string[$i] ^ $string[$l-$i]; $string[$i] = $string[$i] ^ $string[$l-$i]; } return $string; } echo reverseString('fooooooooo');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/l4Lfc
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 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 6
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 6
Branch analysis from position: 29
Branch analysis from position: 6
filename:       /in/l4Lfc
function name:  reverseString
number of ops:  31
compiled vars:  !0 = $string, !1 = $l, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        STRLEN                                           ~3      !0
          2        SUB                                              ~4      ~3, 1
          3        ASSIGN                                                   !1, ~4
    6     4        ASSIGN                                                   !2, 0
          5      > JMP                                                      ->26
    8     6    >   FETCH_DIM_R                                      ~8      !0, !2
          7        SUB                                              ~9      !1, !2
          8        FETCH_DIM_R                                      ~10     !0, ~9
          9        BW_XOR                                           ~11     ~8, ~10
         10        ASSIGN_DIM                                               !0, !2
         11        OP_DATA                                                  ~11
    9    12        SUB                                              ~12     !1, !2
         13        FETCH_DIM_R                                      ~14     !0, !2
         14        SUB                                              ~15     !1, !2
         15        FETCH_DIM_R                                      ~16     !0, ~15
         16        BW_XOR                                           ~17     ~14, ~16
         17        ASSIGN_DIM                                               !0, ~12
         18        OP_DATA                                                  ~17
   10    19        FETCH_DIM_R                                      ~19     !0, !2
         20        SUB                                              ~20     !1, !2
         21        FETCH_DIM_R                                      ~21     !0, ~20
         22        BW_XOR                                           ~22     ~19, ~21
         23        ASSIGN_DIM                                               !0, !2
         24        OP_DATA                                                  ~22
    6    25        PRE_INC                                                  !2
         26    >   DIV                                              ~24     !1, 2
         27        IS_SMALLER                                               !2, ~24
         28      > JMPNZ                                                    ~25, ->6
   12    29    > > RETURN                                                   !0
   13    30*     > RETURN                                                   null

End of function reversestring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.12 ms | 1402 KiB | 14 Q