3v4l.org

run code in 300+ PHP versions simultaneously
<?php function arabic2roman($N) { $c = 'IVXLCDM'; for ($a = 5, $b = $s = ''; $N; $b++, $a ^= 7) for ($o = $N % $a, $N = $N / $a ^ 0; $o--; $s = $c[($o > 2 ? $b + $N - ($N &= -2) + $o = 1 : $b)?:0] . $s) ; return $s; } echo arabic2roman(2014);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4h9WS
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'arabic2roman'
          1        SEND_VAL                                                 2014
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function arabic2roman:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 6
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 12
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 6
Branch analysis from position: 32
Branch analysis from position: 6
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 12
Branch analysis from position: 29
Branch analysis from position: 12
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 12
Branch analysis from position: 29
Branch analysis from position: 12
filename:       /in/4h9WS
function name:  arabic2roman
number of ops:  34
compiled vars:  !0 = $N, !1 = $c, !2 = $a, !3 = $b, !4 = $s, !5 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 'IVXLCDM'
    5     2        ASSIGN                                                   !2, 5
          3        ASSIGN                                           ~8      !4, ''
          4        ASSIGN                                                   !3, ~8
          5      > JMP                                                      ->31
    6     6    >   MOD                                              ~10     !0, !2
          7        ASSIGN                                                   !5, ~10
          8        DIV                                              ~12     !0, !2
          9        BW_XOR                                           ~13     ~12, 0
         10        ASSIGN                                                   !0, ~13
         11      > JMP                                                      ->27
         12    >   IS_SMALLER                                               2, !5
         13      > JMPZ                                                     ~15, ->21
         14    >   ADD                                              ~16     !3, !0
         15        ASSIGN_OP                                    10  ~17     !0, -2
         16        SUB                                              ~18     ~16, ~17
         17        ASSIGN                                           ~19     !5, 1
         18        ADD                                              ~20     ~18, ~19
         19        QM_ASSIGN                                        ~21     ~20
         20      > JMP                                                      ->22
         21    >   QM_ASSIGN                                        ~21     !3
         22    >   JMP_SET                                          ~22     ~21, ->24
         23        QM_ASSIGN                                        ~22     0
         24        FETCH_DIM_R                                      ~23     !1, ~22
         25        CONCAT                                           ~24     ~23, !4
         26        ASSIGN                                                   !4, ~24
         27    >   POST_DEC                                         ~26     !5
         28      > JMPNZ                                                    ~26, ->12
    5    29    >   PRE_INC                                                  !3
         30        ASSIGN_OP                                    11          !2, 7
         31    > > JMPNZ                                                    !0, ->6
    7    32    > > RETURN                                                   !4
    8    33*     > RETURN                                                   null

End of function arabic2roman

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.63 ms | 1403 KiB | 14 Q