3v4l.org

run code in 300+ PHP versions simultaneously
<?php function reverseString($string) { $l = strlen($string); 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; } var_dump(reverseString('foo'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NJZOj
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'reversestring'
          2        SEND_VAL                                                 'foo'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

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

End of function reversestring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.98 ms | 1407 KiB | 16 Q