3v4l.org

run code in 300+ PHP versions simultaneously
<?php function string_to_ascii($string) { $ascii = NULL; for ($i = 0; $i < strlen($string); $i++) { $ascii += ord($string[$i]); } return($ascii); } function calc($a, $b) { $l1 = strlen($a); $l2 = strlen($b); $l = min($l1, $l2); $r = ''; for($i = 0; $i < $l; $i++) { $r .= chr(ord($a[$i]) ^ ord($b[$i])); } return $r; } $a = "8112yuyuiuoui"; $b = "p90187opoipi[i[o[bnmmvhfdfhgj"; var_dump(calc($a, $b)); var_dump($a ^ $b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jsPav
function name:  (null)
number of ops:  14
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   ASSIGN                                                   !0, '8112yuyuiuoui'
   31     1        ASSIGN                                                   !1, 'p90187opoipi%5Bi%5Bo%5Bbnmmvhfdfhgj'
   33     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'calc'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $4      
          7        SEND_VAR                                                 $4
          8        DO_ICALL                                                 
   35     9        INIT_FCALL                                               'var_dump'
         10        BW_XOR                                           ~6      !0, !1
         11        SEND_VAL                                                 ~6
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function string_to_ascii:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 13, Position 2 = 4
Branch analysis from position: 13
Branch analysis from position: 4
filename:       /in/jsPav
function name:  string_to_ascii
number of ops:  15
compiled vars:  !0 = $string, !1 = $ascii, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, null
    7     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->10
    9     4    >   INIT_FCALL                                               'ord'
          5        FETCH_DIM_R                                      ~5      !0, !2
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                         $6      
          8        ASSIGN_OP                                     1          !1, $6
    7     9        PRE_INC                                                  !2
         10    >   STRLEN                                           ~9      !0
         11        IS_SMALLER                                               !2, ~9
         12      > JMPNZ                                                    ~10, ->4
   12    13    > > RETURN                                                   !1
   13    14*     > RETURN                                                   null

End of function string_to_ascii

Function calc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 14
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 14
Branch analysis from position: 30
Branch analysis from position: 14
filename:       /in/jsPav
function name:  calc
number of ops:  32
compiled vars:  !0 = $a, !1 = $b, !2 = $l1, !3 = $l2, !4 = $l, !5 = $r, !6 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        STRLEN                                           ~7      !0
          3        ASSIGN                                                   !2, ~7
   18     4        STRLEN                                           ~9      !1
          5        ASSIGN                                                   !3, ~9
   20     6        INIT_FCALL                                               'min'
          7        SEND_VAR                                                 !2
          8        SEND_VAR                                                 !3
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !4, $11
   22    11        ASSIGN                                                   !5, ''
   23    12        ASSIGN                                                   !6, 0
         13      > JMP                                                      ->28
   24    14    >   INIT_FCALL                                               'chr'
         15        INIT_FCALL                                               'ord'
         16        FETCH_DIM_R                                      ~15     !0, !6
         17        SEND_VAL                                                 ~15
         18        DO_ICALL                                         $16     
         19        INIT_FCALL                                               'ord'
         20        FETCH_DIM_R                                      ~17     !1, !6
         21        SEND_VAL                                                 ~17
         22        DO_ICALL                                         $18     
         23        BW_XOR                                           ~19     $16, $18
         24        SEND_VAL                                                 ~19
         25        DO_ICALL                                         $20     
         26        ASSIGN_OP                                     8          !5, $20
   23    27        PRE_INC                                                  !6
         28    >   IS_SMALLER                                               !6, !4
         29      > JMPNZ                                                    ~23, ->14
   27    30    > > RETURN                                                   !5
   28    31*     > RETURN                                                   null

End of function calc

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.39 ms | 1403 KiB | 22 Q