3v4l.org

run code in 300+ PHP versions simultaneously
<?php $r = 5; $f = 'somethingdumb'; function csc($c, $a) { if ($a < 0) { return csc($c, $a + 26); } $cd = ord($c); if (($cd >= 65) && ($cd <= 90)) { $c = chr((($cd - 65 + $a) % 26) + 65); } if (($cd >= 97) && ($cd <= 122)) { $c = chr((($cd - 97 + $a) % 26) + 97); } return $c; }; function crs($f) { global $r; $a = str_split($f); $cd = ""; for ($i=0; $i<count($a); $i++) { echo (($i+1) * $r). " | "; $cd .= csc($a[$i], ($i+1) * $r); } echo "\n"; return $cd; } function rcs($f, $o) { $a = str_split($f); $cd = ""; for ($i=0; $i<count($a); $i++) { echo (($i+1) * $o). " | "; $cd .= csc($a[$i], ($i+1) * $r); } return $cd; } var_dump(crs($f)); var_dump($r); var_dump(rcs($f, abs($r)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dSQVR
function name:  (null)
number of ops:  22
compiled vars:  !0 = $r, !1 = $f
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 5
    3     1        ASSIGN                                                   !1, 'somethingdumb'
   44     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'crs'
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
   45     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
   46    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'rcs'
         13        SEND_VAR                                                 !1
         14        INIT_FCALL                                               'abs'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $7      
         17        SEND_VAR                                                 $7
         18        DO_FCALL                                      0  $8      
         19        SEND_VAR                                                 $8
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Function csc:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 10
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 27
Branch analysis from position: 19
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 31
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 40
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
Branch analysis from position: 31
Branch analysis from position: 27
Branch analysis from position: 18
filename:       /in/dSQVR
function name:  csc
number of ops:  42
compiled vars:  !0 = $c, !1 = $a, !2 = $cd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        IS_SMALLER                                               !1, 0
          3      > JMPZ                                                     ~3, ->10
    8     4    >   INIT_FCALL_BY_NAME                                       'csc'
          5        SEND_VAR_EX                                              !0
          6        ADD                                              ~4      !1, 26
          7        SEND_VAL_EX                                              ~4
          8        DO_FCALL                                      0  $5      
          9      > RETURN                                                   $5
   10    10    >   INIT_FCALL                                               'ord'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $6      
         13        ASSIGN                                                   !2, $6
   11    14        IS_SMALLER_OR_EQUAL                              ~8      65, !2
         15      > JMPZ_EX                                          ~8      ~8, ->18
         16    >   IS_SMALLER_OR_EQUAL                              ~9      !2, 90
         17        BOOL                                             ~8      ~9
         18    > > JMPZ                                                     ~8, ->27
   12    19    >   INIT_FCALL                                               'chr'
         20        SUB                                              ~10     !2, 65
         21        ADD                                              ~11     ~10, !1
         22        MOD                                              ~12     ~11, 26
         23        ADD                                              ~13     ~12, 65
         24        SEND_VAL                                                 ~13
         25        DO_ICALL                                         $14     
         26        ASSIGN                                                   !0, $14
   14    27    >   IS_SMALLER_OR_EQUAL                              ~16     97, !2
         28      > JMPZ_EX                                          ~16     ~16, ->31
         29    >   IS_SMALLER_OR_EQUAL                              ~17     !2, 122
         30        BOOL                                             ~16     ~17
         31    > > JMPZ                                                     ~16, ->40
   15    32    >   INIT_FCALL                                               'chr'
         33        SUB                                              ~18     !2, 97
         34        ADD                                              ~19     ~18, !1
         35        MOD                                              ~20     ~19, 26
         36        ADD                                              ~21     ~20, 97
         37        SEND_VAL                                                 ~21
         38        DO_ICALL                                         $22     
         39        ASSIGN                                                   !0, $22
   17    40    > > RETURN                                                   !0
   18    41*     > RETURN                                                   null

End of function csc

Function crs:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 9
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 9
Branch analysis from position: 25
Branch analysis from position: 9
filename:       /in/dSQVR
function name:  crs
number of ops:  28
compiled vars:  !0 = $f, !1 = $r, !2 = $a, !3 = $cd, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        BIND_GLOBAL                                              !1, 'r'
   23     2        INIT_FCALL                                               'str_split'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !2, $5
   24     6        ASSIGN                                                   !3, ''
   25     7        ASSIGN                                                   !4, 0
          8      > JMP                                                      ->22
   26     9    >   ADD                                              ~9      !4, 1
         10        MUL                                              ~10     !1, ~9
         11        CONCAT                                           ~11     ~10, '+%7C+'
         12        ECHO                                                     ~11
   27    13        INIT_FCALL                                               'csc'
         14        FETCH_DIM_R                                      ~12     !2, !4
         15        SEND_VAL                                                 ~12
         16        ADD                                              ~13     !4, 1
         17        MUL                                              ~14     !1, ~13
         18        SEND_VAL                                                 ~14
         19        DO_FCALL                                      0  $15     
         20        ASSIGN_OP                                     8          !3, $15
   25    21        PRE_INC                                                  !4
         22    >   COUNT                                            ~18     !2
         23        IS_SMALLER                                               !4, ~18
         24      > JMPNZ                                                    ~19, ->9
   29    25    >   ECHO                                                     '%0A'
   30    26      > RETURN                                                   !3
   31    27*     > RETURN                                                   null

End of function crs

Function rcs:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 9
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 25, Position 2 = 9
Branch analysis from position: 25
Branch analysis from position: 9
filename:       /in/dSQVR
function name:  rcs
number of ops:  27
compiled vars:  !0 = $f, !1 = $o, !2 = $a, !3 = $cd, !4 = $i, !5 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   35     2        INIT_FCALL                                               'str_split'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !2, $6
   36     6        ASSIGN                                                   !3, ''
   37     7        ASSIGN                                                   !4, 0
          8      > JMP                                                      ->22
   38     9    >   ADD                                              ~10     !4, 1
         10        MUL                                              ~11     !1, ~10
         11        CONCAT                                           ~12     ~11, '+%7C+'
         12        ECHO                                                     ~12
   39    13        INIT_FCALL                                               'csc'
         14        FETCH_DIM_R                                      ~13     !2, !4
         15        SEND_VAL                                                 ~13
         16        ADD                                              ~14     !4, 1
         17        MUL                                              ~15     !5, ~14
         18        SEND_VAL                                                 ~15
         19        DO_FCALL                                      0  $16     
         20        ASSIGN_OP                                     8          !3, $16
   37    21        PRE_INC                                                  !4
         22    >   COUNT                                            ~19     !2
         23        IS_SMALLER                                               !4, ~19
         24      > JMPNZ                                                    ~20, ->9
   41    25    > > RETURN                                                   !3
   42    26*     > RETURN                                                   null

End of function rcs

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.7 ms | 1410 KiB | 27 Q