3v4l.org

run code in 300+ PHP versions simultaneously
<?php function checkOGRN($ogrn){ $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; return ($result == $check); } print_r(checkOGRN('311333426300044'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Hafdc
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   INIT_FCALL                                               'print_r'
          1        INIT_FCALL                                               'checkogrn'
          2        SEND_VAL                                                 '311333426300044'
          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 = 18, Position 2 = 25
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/Hafdc
function name:  checkOGRN
number of ops:  28
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        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 0
          4        SEND_VAL                                                 12
          5        DO_ICALL                                         $6      
          6        CAST                                          4  ~7      $6
          7        ASSIGN                                                   !1, ~7
    4     8        INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 -1
         11        DO_ICALL                                         $9      
         12        CAST                                          4  ~10     $9
         13        ASSIGN                                                   !2, ~10
    5    14        MOD                                              ~12     !1, 11
         15        ASSIGN                                                   !3, ~12
    6    16        IS_SMALLER                                               9, !3
         17      > JMPZ                                                     ~14, ->25
         18    >   INIT_FCALL                                               'round'
         19        DIV                                              ~15     !3, 10
         20        SEND_VAL                                                 ~15
         21        DO_ICALL                                         $16     
         22        MUL                                              ~17     $16, 10
         23        SUB                                              ~18     !3, ~17
         24        FREE                                                     ~18
    7    25    >   IS_EQUAL                                         ~19     !4, !5
         26      > RETURN                                                   ~19
    8    27*     > RETURN                                                   null

End of function checkogrn

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.1 ms | 1399 KiB | 20 Q