3v4l.org

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

Function reversestring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 5
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 55, Position 2 = 5
Branch analysis from position: 55
Branch analysis from position: 5
filename:       /in/QA42s
function name:  reverseString
number of ops:  57
compiled vars:  !0 = $string, !1 = $len, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        STRLEN                                           ~3      !0
          2        ASSIGN                                                   !1, ~3
    6     3        ASSIGN                                                   !2, 0
          4      > JMP                                                      ->52
    7     5    >   INIT_FCALL                                               'chr'
          6        INIT_FCALL                                               'ord'
          7        FETCH_DIM_R                                      ~7      !0, !2
          8        SEND_VAL                                                 ~7
          9        DO_ICALL                                         $8      
         10        INIT_FCALL                                               'ord'
         11        SUB                                              ~9      !1, !2
         12        FETCH_DIM_R                                      ~10     !0, ~9
         13        SEND_VAL                                                 ~10
         14        DO_ICALL                                         $11     
         15        BW_XOR                                           ~12     $8, $11
         16        SEND_VAL                                                 ~12
         17        DO_ICALL                                         $13     
         18        ASSIGN_DIM                                               !0, !2
         19        OP_DATA                                                  $13
    8    20        SUB                                              ~14     !1, !2
         21        INIT_FCALL                                               'chr'
         22        INIT_FCALL                                               'ord'
         23        FETCH_DIM_R                                      ~16     !0, !2
         24        SEND_VAL                                                 ~16
         25        DO_ICALL                                         $17     
         26        INIT_FCALL                                               'ord'
         27        SUB                                              ~18     !1, !2
         28        FETCH_DIM_R                                      ~19     !0, ~18
         29        SEND_VAL                                                 ~19
         30        DO_ICALL                                         $20     
         31        BW_XOR                                           ~21     $17, $20
         32        SEND_VAL                                                 ~21
         33        DO_ICALL                                         $22     
         34        ASSIGN_DIM                                               !0, ~14
         35        OP_DATA                                                  $22
    9    36        INIT_FCALL                                               'chr'
         37        INIT_FCALL                                               'ord'
         38        FETCH_DIM_R                                      ~24     !0, !2
         39        SEND_VAL                                                 ~24
         40        DO_ICALL                                         $25     
         41        INIT_FCALL                                               'ord'
         42        SUB                                              ~26     !1, !2
         43        FETCH_DIM_R                                      ~27     !0, ~26
         44        SEND_VAL                                                 ~27
         45        DO_ICALL                                         $28     
         46        BW_XOR                                           ~29     $25, $28
         47        SEND_VAL                                                 ~29
         48        DO_ICALL                                         $30     
         49        ASSIGN_DIM                                               !0, !2
         50        OP_DATA                                                  $30
    6    51        PRE_INC                                                  !2
         52    >   DIV                                              ~32     !1, 2
         53        IS_SMALLER                                               !2, ~32
         54      > JMPNZ                                                    ~33, ->5
   11    55    > > RETURN                                                   !0
   12    56*     > RETURN                                                   null

End of function reversestring

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.58 ms | 1402 KiB | 18 Q