3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rome($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].$s); return $s; } $some_string = "2257"; echo rome($some_string);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QFJX2
function name:  (null)
number of ops:  6
compiled vars:  !0 = $some_string
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, '2257'
   10     1        INIT_FCALL                                               'rome'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function rome:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 6
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 12
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 30, Position 2 = 6
Branch analysis from position: 30
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 = 27, Position 2 = 12
Branch analysis from position: 27
Branch analysis from position: 12
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 12
Branch analysis from position: 27
Branch analysis from position: 12
filename:       /in/QFJX2
function name:  rome
number of ops:  32
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      
    3     1        ASSIGN                                                   !1, 'IVXLCDM'
    4     2        ASSIGN                                                   !2, 5
          3        ASSIGN                                           ~8      !4, ''
          4        ASSIGN                                                   !3, ~8
          5      > JMP                                                      ->29
    5     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                                                      ->25
         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    >   FETCH_DIM_R                                      ~22     !1, ~21
         23        CONCAT                                           ~23     ~22, !4
         24        ASSIGN                                                   !4, ~23
         25    >   POST_DEC                                         ~25     !5
         26      > JMPNZ                                                    ~25, ->12
    4    27    >   PRE_INC                                                  !3
         28        ASSIGN_OP                                    11          !2, 7
         29    > > JMPNZ                                                    !0, ->6
    6    30    > > RETURN                                                   !4
    7    31*     > RETURN                                                   null

End of function rome

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.21 ms | 1403 KiB | 14 Q