3v4l.org

run code in 300+ PHP versions simultaneously
<?php function koap2digit($koap){ $o = array('#[^.0-9]#','#[.]{2,}#'); $n = array('','.'); $digits = preg_replace($o, $n, $koap); $ar = explode('.', $digits); $r = 10^6; $num = 0; foreach($ar as $k => $v) { if($k == 0)$num = $v*100; elseif($k == 1) { $num = ($num+$v)*$r; } else { $r = $r/100; $num += $v*$r; } } return $num; } echo koap2digit('12.21.1 ч.1.1');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YBSQQ
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   INIT_FCALL                                               'koap2digit'
          1        SEND_VAL                                                 '12.21.1+%D1%87.1.1'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function koap2digit:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 35
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 35
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 30
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 35
filename:       /in/YBSQQ
function name:  koap2digit
number of ops:  38
compiled vars:  !0 = $koap, !1 = $o, !2 = $n, !3 = $digits, !4 = $ar, !5 = $r, !6 = $num, !7 = $v, !8 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, <array>
    5     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !1
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $11     
          8        ASSIGN                                                   !3, $11
    6     9        INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '.'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $13     
         13        ASSIGN                                                   !4, $13
    7    14        ASSIGN                                                   !5, 12
    8    15        ASSIGN                                                   !6, 0
    9    16      > FE_RESET_R                                       $17     !4, ->35
         17    > > FE_FETCH_R                                       ~18     $17, !7, ->35
         18    >   ASSIGN                                                   !8, ~18
   11    19        IS_EQUAL                                                 !8, 0
         20      > JMPZ                                                     ~20, ->24
         21    >   MUL                                              ~21     !7, 100
         22        ASSIGN                                                   !6, ~21
         23      > JMP                                                      ->34
   12    24    >   IS_EQUAL                                                 !8, 1
         25      > JMPZ                                                     ~23, ->30
   14    26    >   ADD                                              ~24     !6, !7
         27        MUL                                              ~25     !5, ~24
         28        ASSIGN                                                   !6, ~25
         29      > JMP                                                      ->34
   18    30    >   DIV                                              ~27     !5, 100
         31        ASSIGN                                                   !5, ~27
   19    32        MUL                                              ~29     !7, !5
         33        ASSIGN_OP                                     1          !6, ~29
    9    34    > > JMP                                                      ->17
         35    >   FE_FREE                                                  $17
   22    36      > RETURN                                                   !6
   23    37*     > RETURN                                                   null

End of function koap2digit

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.66 ms | 1402 KiB | 18 Q