3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getNewLetter(string $letter, int $number): string { $newOrd = (ord($letter) + $number - 65) % 26; if ($newOrd < 0) { $newOrd += 26; } return chr(65 + $newOrd); } echo getNewLetter("H", 4); echo getNewLetter("H", 26); echo getNewLetter("H", -32);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qCidW
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_FCALL                                               'getnewletter'
          1        SEND_VAL                                                 'H'
          2        SEND_VAL                                                 4
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
   14     5        INIT_FCALL                                               'getnewletter'
          6        SEND_VAL                                                 'H'
          7        SEND_VAL                                                 26
          8        DO_FCALL                                      0  $1      
          9        ECHO                                                     $1
   15    10        INIT_FCALL                                               'getnewletter'
         11        SEND_VAL                                                 'H'
         12        SEND_VAL                                                 -32
         13        DO_FCALL                                      0  $2      
         14        ECHO                                                     $2
         15      > RETURN                                                   1

Function getnewletter:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/qCidW
function name:  getNewLetter
number of ops:  20
compiled vars:  !0 = $letter, !1 = $number, !2 = $newOrd
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'ord'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5        ADD                                              ~4      $3, !1
          6        SUB                                              ~5      ~4, 65
          7        MOD                                              ~6      ~5, 26
          8        ASSIGN                                                   !2, ~6
    6     9        IS_SMALLER                                               !2, 0
         10      > JMPZ                                                     ~8, ->12
    7    11    >   ASSIGN_OP                                     1          !2, 26
   10    12    >   INIT_FCALL                                               'chr'
         13        ADD                                              ~10     65, !2
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                         $11     
         16        VERIFY_RETURN_TYPE                                       $11
         17      > RETURN                                                   $11
   11    18*       VERIFY_RETURN_TYPE                                       
         19*     > RETURN                                                   null

End of function getnewletter

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.71 ms | 1002 KiB | 18 Q