3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkOGRN($ogrn){ if (strlen($ogrn) == 13) { $verify_num = intval(substr($ogrn, 0, 12)); $check_num = intval(substr($ogrn, -1)); $res_num = $verify_num % 11; if ($res_num > 9) $res_num - round($res_num/10)*10; if ($result == $check) return true; } elseif (strlen($ogrn) == 15) { $verify_num = intval(substr($ogrn, 0, 14)); $check_num = intval(substr($ogrn, -1)); $res_num = $verify_num % 13; if ($res_num > 9) $res_num - round($res_num/10)*10; if ($result == $check) return true; } else return false; } print_r(checkOGRN('311333426300144'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FJRml
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'checkogrn'
          2        SEND_VAL                                                 '311333426300144'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function checkogrn:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 32
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 28
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 63
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 59
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 62
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
Branch analysis from position: 59
Branch analysis from position: 63
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FJRml
function name:  checkOGRN
number of ops:  65
compiled vars:  !0 = $ogrn, !1 = $verify_num, !2 = $check_num, !3 = $res_num, !4 = $result, !5 = $check
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        STRLEN                                           ~6      !0
          2        IS_EQUAL                                                 ~6, 13
          3      > JMPZ                                                     ~7, ->32
    4     4    >   INIT_FCALL                                               'substr'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 0
          7        SEND_VAL                                                 12
          8        DO_ICALL                                         $8      
          9        CAST                                          4  ~9      $8
         10        ASSIGN                                                   !1, ~9
    5    11        INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 -1
         14        DO_ICALL                                         $11     
         15        CAST                                          4  ~12     $11
         16        ASSIGN                                                   !2, ~12
    6    17        MOD                                              ~14     !1, 11
         18        ASSIGN                                                   !3, ~14
    7    19        IS_SMALLER                                               9, !3
         20      > JMPZ                                                     ~16, ->28
         21    >   INIT_FCALL                                               'round'
         22        DIV                                              ~17     !3, 10
         23        SEND_VAL                                                 ~17
         24        DO_ICALL                                         $18     
         25        MUL                                              ~19     $18, 10
         26        SUB                                              ~20     !3, ~19
         27        FREE                                                     ~20
    8    28    >   IS_EQUAL                                                 !4, !5
         29      > JMPZ                                                     ~21, ->31
         30    > > RETURN                                                   <true>
         31    > > JMP                                                      ->64
    9    32    >   STRLEN                                           ~22     !0
         33        IS_EQUAL                                                 ~22, 15
         34      > JMPZ                                                     ~23, ->63
   10    35    >   INIT_FCALL                                               'substr'
         36        SEND_VAR                                                 !0
         37        SEND_VAL                                                 0
         38        SEND_VAL                                                 14
         39        DO_ICALL                                         $24     
         40        CAST                                          4  ~25     $24
         41        ASSIGN                                                   !1, ~25
   11    42        INIT_FCALL                                               'substr'
         43        SEND_VAR                                                 !0
         44        SEND_VAL                                                 -1
         45        DO_ICALL                                         $27     
         46        CAST                                          4  ~28     $27
         47        ASSIGN                                                   !2, ~28
   12    48        MOD                                              ~30     !1, 13
         49        ASSIGN                                                   !3, ~30
   13    50        IS_SMALLER                                               9, !3
         51      > JMPZ                                                     ~32, ->59
         52    >   INIT_FCALL                                               'round'
         53        DIV                                              ~33     !3, 10
         54        SEND_VAL                                                 ~33
         55        DO_ICALL                                         $34     
         56        MUL                                              ~35     $34, 10
         57        SUB                                              ~36     !3, ~35
         58        FREE                                                     ~36
   14    59    >   IS_EQUAL                                                 !4, !5
         60      > JMPZ                                                     ~37, ->62
         61    > > RETURN                                                   <true>
         62    > > JMP                                                      ->64
   15    63    > > RETURN                                                   <false>
   16    64    > > RETURN                                                   null

End of function checkogrn

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.79 ms | 1394 KiB | 20 Q