3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = '(+0031)6 12 34 56 77'; $number = str_replace(['(', ' ', ')'], '', $number); // 0xxxxxxxxx if (strlen($number) == 10) { if (0 === strpos($number, '0')) { $result = true; } // 31xxxxxxxxx } elseif (strlen($number) == 11) { if (0 === strpos($number, '31')) { $result = true; } // +31xxxxxxxxx } elseif (strlen($number) == 12) { if (0 === strpos($number, '+31')) { $result = true; } // 0031xxxxxxxxx } elseif (strlen($number) == 13) { if (0 === strpos($number, '0031')) { $result = true; } } var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 18
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 29
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
Branch analysis from position: 28
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 32, Position 2 = 40
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 38, Position 2 = 39
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
Branch analysis from position: 39
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 50
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 50
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 50
Branch analysis from position: 50
filename:       /in/jprGG
function name:  (null)
number of ops:  54
compiled vars:  !0 = $number, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%28%2B0031%296+12+34+56+77'
    4     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 <array>
          3        SEND_VAL                                                 ''
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $3      
          6        ASSIGN                                                   !0, $3
    7     7        STRLEN                                           ~5      !0
          8        IS_EQUAL                                                 ~5, 10
          9      > JMPZ                                                     ~6, ->18
    8    10    >   INIT_FCALL                                               'strpos'
         11        SEND_VAR                                                 !0
         12        SEND_VAL                                                 '0'
         13        DO_ICALL                                         $7      
         14        IS_IDENTICAL                                             $7, 0
         15      > JMPZ                                                     ~8, ->17
    9    16    >   ASSIGN                                                   !1, <true>
         17    > > JMP                                                      ->50
   12    18    >   STRLEN                                           ~10     !0
         19        IS_EQUAL                                                 ~10, 11
         20      > JMPZ                                                     ~11, ->29
   13    21    >   INIT_FCALL                                               'strpos'
         22        SEND_VAR                                                 !0
         23        SEND_VAL                                                 '31'
         24        DO_ICALL                                         $12     
         25        IS_IDENTICAL                                             $12, 0
         26      > JMPZ                                                     ~13, ->28
   14    27    >   ASSIGN                                                   !1, <true>
         28    > > JMP                                                      ->50
   17    29    >   STRLEN                                           ~15     !0
         30        IS_EQUAL                                                 ~15, 12
         31      > JMPZ                                                     ~16, ->40
   18    32    >   INIT_FCALL                                               'strpos'
         33        SEND_VAR                                                 !0
         34        SEND_VAL                                                 '%2B31'
         35        DO_ICALL                                         $17     
         36        IS_IDENTICAL                                             $17, 0
         37      > JMPZ                                                     ~18, ->39
   19    38    >   ASSIGN                                                   !1, <true>
         39    > > JMP                                                      ->50
   22    40    >   STRLEN                                           ~20     !0
         41        IS_EQUAL                                                 ~20, 13
         42      > JMPZ                                                     ~21, ->50
   23    43    >   INIT_FCALL                                               'strpos'
         44        SEND_VAR                                                 !0
         45        SEND_VAL                                                 '0031'
         46        DO_ICALL                                         $22     
         47        IS_IDENTICAL                                             $22, 0
         48      > JMPZ                                                     ~23, ->50
   24    49    >   ASSIGN                                                   !1, <true>
   28    50    >   INIT_FCALL                                               'var_dump'
         51        SEND_VAR                                                 !1
         52        DO_ICALL                                                 
         53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
216.35 ms | 1400 KiB | 19 Q