3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strings[] = "http://t.me/tm_factory_bot"; //0 $strings[] = "https://telegram.me/tm_factory_bot"; //1 $strings[] = "https://telegram.me/tm_factory_bot?start=123"; //2 $strings[] = "tg://resolve?domain=buy_this"; //3 $strings[] = "tg://resolve?domain=buy_this&start=123"; //4 $strings[] = "https://t.me/joinchat/AAAAAEOI5lHxvYlMxwHGSA"; //5 $strings[] = "https://web.telegram.org/#/im?tgaddr=tg%3A%2F%2Fjoin%3Finvite%3DAAAAAEOI5lHxvYlMxwH-GSA"; //6 $strings[] = "https://web.telegram.org/#/im?tgaddr=tg%3A%2F%2Fresolve%3Fdomain%3Dbuy_this"; //7 $strings[] = "https://web.telegram.org/#/im?tgaddr=tg%3A%2F%2Fresolve%3Fdomain%3Dtm_factory_bot%26start%3D123"; //8 $strings[] = "https://web.telegram.org/#/im?p=@funny_images"; //9 $strings[] = "@funny_images"; //10 $strings[] = "funny_images"; //11 $strings[] = "tg://join?invite=AAAAAEOI5lHxvYlMxwHGSA"; //12 foreach ($strings as $key=>$string) { $tgType = true; if ($tgType) { $private = "tg://join?invite="; $public = "tg://resolve?domain="; $sep = "&"; } else { $private = "https://t.me/joinchat/"; $public = "https://t.me/"; $sep = "?"; } $value = urldecode($string); preg_match('#[^&\?]??([a-z_0-9\-]+)[&\?]??(start=[a-z0-9]*?)?$#i', $value, $preg); if (preg_match("#(invite=|joinchat/)#i", $value)) { $link = $private . $preg[1]; } else { $link = $public . $preg[1]; } if (isset($preg[2])) { $link .= $sep . $preg[2]; } echo "\r\n" . $key . " - " . $link; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 69
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 69
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 31, Position 2 = 35
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 56
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 64
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 64
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 64
Branch analysis from position: 61
Branch analysis from position: 64
Branch analysis from position: 35
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 56
Branch analysis from position: 52
Branch analysis from position: 56
Branch analysis from position: 69
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 69
filename:       /in/ru78K
function name:  (null)
number of ops:  71
compiled vars:  !0 = $strings, !1 = $string, !2 = $key, !3 = $tgType, !4 = $private, !5 = $public, !6 = $sep, !7 = $value, !8 = $preg, !9 = $link
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0
          1        OP_DATA                                                  'http%3A%2F%2Ft.me%2Ftm_factory_bot'
    4     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  'https%3A%2F%2Ftelegram.me%2Ftm_factory_bot'
    5     4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  'https%3A%2F%2Ftelegram.me%2Ftm_factory_bot%3Fstart%3D123'
    6     6        ASSIGN_DIM                                               !0
          7        OP_DATA                                                  'tg%3A%2F%2Fresolve%3Fdomain%3Dbuy_this'
    7     8        ASSIGN_DIM                                               !0
          9        OP_DATA                                                  'tg%3A%2F%2Fresolve%3Fdomain%3Dbuy_this%26start%3D123'
    8    10        ASSIGN_DIM                                               !0
         11        OP_DATA                                                  'https%3A%2F%2Ft.me%2Fjoinchat%2FAAAAAEOI5lHxvYlMxwHGSA'
    9    12        ASSIGN_DIM                                               !0
         13        OP_DATA                                                  'https%3A%2F%2Fweb.telegram.org%2F%23%2Fim%3Ftgaddr%3Dtg%253A%252F%252Fjoin%253Finvite%253DAAAAAEOI5lHxvYlMxwH-GSA'
   10    14        ASSIGN_DIM                                               !0
         15        OP_DATA                                                  'https%3A%2F%2Fweb.telegram.org%2F%23%2Fim%3Ftgaddr%3Dtg%253A%252F%252Fresolve%253Fdomain%253Dbuy_this'
   11    16        ASSIGN_DIM                                               !0
         17        OP_DATA                                                  'https%3A%2F%2Fweb.telegram.org%2F%23%2Fim%3Ftgaddr%3Dtg%253A%252F%252Fresolve%253Fdomain%253Dtm_factory_bot%2526start%253D123'
   12    18        ASSIGN_DIM                                               !0
         19        OP_DATA                                                  'https%3A%2F%2Fweb.telegram.org%2F%23%2Fim%3Fp%3D%40funny_images'
   13    20        ASSIGN_DIM                                               !0
         21        OP_DATA                                                  '%40funny_images'
   14    22        ASSIGN_DIM                                               !0
         23        OP_DATA                                                  'funny_images'
   15    24        ASSIGN_DIM                                               !0
         25        OP_DATA                                                  'tg%3A%2F%2Fjoin%3Finvite%3DAAAAAEOI5lHxvYlMxwHGSA'
   18    26      > FE_RESET_R                                       $23     !0, ->69
         27    > > FE_FETCH_R                                       ~24     $23, !1, ->69
         28    >   ASSIGN                                                   !2, ~24
   19    29        ASSIGN                                                   !3, <true>
   20    30      > JMPZ                                                     !3, ->35
   21    31    >   ASSIGN                                                   !4, 'tg%3A%2F%2Fjoin%3Finvite%3D'
   22    32        ASSIGN                                                   !5, 'tg%3A%2F%2Fresolve%3Fdomain%3D'
   23    33        ASSIGN                                                   !6, '%26'
         34      > JMP                                                      ->38
   25    35    >   ASSIGN                                                   !4, 'https%3A%2F%2Ft.me%2Fjoinchat%2F'
   26    36        ASSIGN                                                   !5, 'https%3A%2F%2Ft.me%2F'
   27    37        ASSIGN                                                   !6, '%3F'
   29    38    >   INIT_FCALL                                               'urldecode'
         39        SEND_VAR                                                 !1
         40        DO_ICALL                                         $33     
         41        ASSIGN                                                   !7, $33
   30    42        INIT_FCALL                                               'preg_match'
         43        SEND_VAL                                                 '%23%5B%5E%26%5C%3F%5D%3F%3F%28%5Ba-z_0-9%5C-%5D%2B%29%5B%26%5C%3F%5D%3F%3F%28start%3D%5Ba-z0-9%5D%2A%3F%29%3F%24%23i'
         44        SEND_VAR                                                 !7
         45        SEND_REF                                                 !8
         46        DO_ICALL                                                 
   32    47        INIT_FCALL                                               'preg_match'
         48        SEND_VAL                                                 '%23%28invite%3D%7Cjoinchat%2F%29%23i'
         49        SEND_VAR                                                 !7
         50        DO_ICALL                                         $36     
         51      > JMPZ                                                     $36, ->56
   33    52    >   FETCH_DIM_R                                      ~37     !8, 1
         53        CONCAT                                           ~38     !4, ~37
         54        ASSIGN                                                   !9, ~38
         55      > JMP                                                      ->59
   35    56    >   FETCH_DIM_R                                      ~40     !8, 1
         57        CONCAT                                           ~41     !5, ~40
         58        ASSIGN                                                   !9, ~41
   38    59    >   ISSET_ISEMPTY_DIM_OBJ                         0          !8, 2
         60      > JMPZ                                                     ~43, ->64
   39    61    >   FETCH_DIM_R                                      ~44     !8, 2
         62        CONCAT                                           ~45     !6, ~44
         63        ASSIGN_OP                                     8          !9, ~45
   41    64    >   CONCAT                                           ~47     '%0D%0A', !2
         65        CONCAT                                           ~48     ~47, '+-+'
         66        CONCAT                                           ~49     ~48, !9
         67        ECHO                                                     ~49
   18    68      > JMP                                                      ->27
         69    >   FE_FREE                                                  $23
   42    70      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.17 ms | 1404 KiB | 17 Q