3v4l.org

run code in 300+ PHP versions simultaneously
<?php function koap2digit($koap){ $o = array('[^\d.]@','\.\.'); $n = array('','.'); $digits = preg_replace($o, $n, $koap); $ar = explode('.', $digits); $r = 1000000; $num = 0; foreach($ar as $k => $v) { if($k == 0)$num = $v*100; elseif($k == 1) { $num = ($num+$v)*$r; } else { $num += $v*($r/100); } } 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/rDt8g
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     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 = 34
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 34
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 = 33
Branch analysis from position: 33
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 = 33
Branch analysis from position: 33
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/rDt8g
function name:  koap2digit
number of ops:  37
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, 1000000
    8    15        ASSIGN                                                   !6, 0
    9    16      > FE_RESET_R                                       $17     !4, ->34
         17    > > FE_FETCH_R                                       ~18     $17, !7, ->34
         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                                                      ->33
   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                                                      ->33
   18    30    >   DIV                                              ~27     !5, 100
         31        MUL                                              ~28     !7, ~27
         32        ASSIGN_OP                                     1          !6, ~28
    9    33    > > JMP                                                      ->17
         34    >   FE_FREE                                                  $17
   21    35      > RETURN                                                   !6
   22    36*     > RETURN                                                   null

End of function koap2digit

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.16 ms | 1403 KiB | 18 Q