3v4l.org

run code in 300+ PHP versions simultaneously
<?php function isIBAN ($iban) { // Remove all whitespace $iban = preg_replace('/\s/', '', $iban); $iban = strtoupper($iban); if(strlen($iban) > 34) { return false; } // Create control number $alfa = str_split('ABCDEFGHIJKLMNOPQRSTUVWXYZ'); for($i = 1; $i < 27; ++$i) { $alfa_replace[] = $i + 9; } $controlNumber = str_replace($alfa, $alfa_replace, substr($iban, 4, strlen($iban)-4) . substr($iban, 0, 2) . "00"); $controlNumber = 98 - (int)bcmod($controlNumber, 97); return ((int)$controlNumber === (int)substr($iban, 2, 2)); } var_dump(isIBAN('999'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cAPqU
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'isiban'
          2        SEND_VAL                                                 '999'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function isiban:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 15
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 21
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 21
Branch analysis from position: 27
Branch analysis from position: 21
filename:       /in/cAPqU
function name:  isIBAN
number of ops:  64
compiled vars:  !0 = $iban, !1 = $alfa, !2 = $i, !3 = $alfa_replace, !4 = $controlNumber
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%2F%5Cs%2F'
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !0, $5
    7     7        INIT_FCALL                                               'strtoupper'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $7      
         10        ASSIGN                                                   !0, $7
    9    11        STRLEN                                           ~9      !0
         12        IS_SMALLER                                               34, ~9
         13      > JMPZ                                                     ~10, ->15
   10    14    > > RETURN                                                   <false>
   14    15    >   INIT_FCALL                                               'str_split'
         16        SEND_VAL                                                 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
         17        DO_ICALL                                         $11     
         18        ASSIGN                                                   !1, $11
   15    19        ASSIGN                                                   !2, 1
         20      > JMP                                                      ->25
   16    21    >   ADD                                              ~15     !2, 9
         22        ASSIGN_DIM                                               !3
         23        OP_DATA                                                  ~15
   15    24        PRE_INC                                                  !2
         25    >   IS_SMALLER                                               !2, 27
         26      > JMPNZ                                                    ~17, ->21
   18    27    >   INIT_FCALL                                               'str_replace'
         28        SEND_VAR                                                 !1
         29        SEND_VAR                                                 !3
         30        INIT_FCALL                                               'substr'
         31        SEND_VAR                                                 !0
         32        SEND_VAL                                                 4
         33        STRLEN                                           ~18     !0
         34        SUB                                              ~19     ~18, 4
         35        SEND_VAL                                                 ~19
         36        DO_ICALL                                         $20     
         37        INIT_FCALL                                               'substr'
         38        SEND_VAR                                                 !0
         39        SEND_VAL                                                 0
         40        SEND_VAL                                                 2
         41        DO_ICALL                                         $21     
         42        CONCAT                                           ~22     $20, $21
         43        CONCAT                                           ~23     ~22, '00'
         44        SEND_VAL                                                 ~23
         45        DO_ICALL                                         $24     
         46        ASSIGN                                                   !4, $24
   19    47        INIT_FCALL_BY_NAME                                       'bcmod'
         48        SEND_VAR_EX                                              !4
         49        SEND_VAL_EX                                              97
         50        DO_FCALL                                      0  $26     
         51        CAST                                          4  ~27     $26
         52        SUB                                              ~28     98, ~27
         53        ASSIGN                                                   !4, ~28
   21    54        CAST                                          4  ~30     !4
         55        INIT_FCALL                                               'substr'
         56        SEND_VAR                                                 !0
         57        SEND_VAL                                                 2
         58        SEND_VAL                                                 2
         59        DO_ICALL                                         $31     
         60        CAST                                          4  ~32     $31
         61        IS_IDENTICAL                                     ~33     ~30, ~32
         62      > RETURN                                                   ~33
   22    63*     > RETURN                                                   null

End of function isiban

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.5 ms | 1403 KiB | 29 Q