3v4l.org

run code in 300+ PHP versions simultaneously
<?php $js_date = "12.12.2013"; $js_time = "10.00"; $str = 'http://www.abctehno.ee'; function auto_link($str, $type = 'both', $popup = FALSE) { if ($type != 'email') { if (preg_match_all("#(^|\s|\()((http(s?)://)|(www\.))(\w+[^\s\)\<]+)#i", $str, $matches)) { $pop = ($popup == TRUE) ? " target=\"_blank\" " : ""; for ($i = 0; $i < sizeof($matches['0']); $i++) { $period = ''; if (preg_match("|\.$|", $matches['6'][$i])) { $period = '.'; $matches['6'][$i] = substr($matches['6'][$i], 0, -1); } $str = str_replace($matches['0'][$i], $matches['1'][$i].'<a href="http'. $matches['4'][$i].'://'. $matches['5'][$i]. $matches['6'][$i].'"'.$pop.'>http'. $matches['4'][$i].'://'. $matches['5'][$i]. $matches['6'][$i].'</a>'. $period, $str); } } } if ($type != 'url') { if (preg_match_all("/([a-zA-Z0-9_\.\-]+)@([a-zA-Z0-9\-]+)\.([a-zA-Z0-9\-\.]*)/i", $str, $matches)) { for ($i = 0; $i < sizeof($matches['0']); $i++) { $period = ''; if (preg_match("|\.$|", $matches['3'][$i])) { $period = '.'; $matches['3'][$i] = substr($matches['3'][$i], 0, -1); } $str = str_replace($matches['0'][$i], safe_mailto($matches['1'][$i].'@'.$matches['2'][$i].'.'.$matches['3'][$i]).$period, $str); } } } return $str; } $email_message ="\n Lugupeetud klient, \n \n teile broneeritud ülevaatuse aeg on ".$js_date." kell ".$js_time.". \n ABC Tehno asub aadressil Sõpruse pst 27, tel: 6 999 227, email: ".$str.".\n Tuletame meelde, et hilinemisel kaotab broneering kehtivuse. \n \n Kohtumiseni, \n ABC Tehno";; echo $email_message; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kMAv5
function name:  (null)
number of ops:  12
compiled vars:  !0 = $js_date, !1 = $js_time, !2 = $str, !3 = $email_message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '12.12.2013'
    3     1        ASSIGN                                                   !1, '10.00'
    4     2        ASSIGN                                                   !2, 'http%3A%2F%2Fwww.abctehno.ee'
   56     3        CONCAT                                           ~7      '%0A+Lugupeetud+klient%2C+%0A+%0A+teile+broneeritud+%C3%BClevaatuse+aeg+on+', !0
          4        CONCAT                                           ~8      ~7, '+kell+'
          5        CONCAT                                           ~9      ~8, !1
          6        CONCAT                                           ~10     ~9, '.+%0A+ABC+Tehno+asub+aadressil+S%C3%B5pruse+pst+27%2C+tel%3A+6+999+227%2C+email%3A+'
          7        CONCAT                                           ~11     ~10, !2
          8        CONCAT                                           ~12     ~11, '.%0A+Tuletame+meelde%2C+et+hilinemisel+kaotab+broneering+kehtivuse.+%0A+%0A+Kohtumiseni%2C+%0A+ABC+Tehno'
          9        ASSIGN                                                   !3, ~12
   57    10        ECHO                                                     !3
         11      > RETURN                                                   1

Function auto_link:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 79
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 79
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 19
Branch analysis from position: 79
2 jumps found. (Code = 43) Position 1 = 81, Position 2 = 135
Branch analysis from position: 81
2 jumps found. (Code = 43) Position 1 = 87, Position 2 = 135
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 131
Branch analysis from position: 131
2 jumps found. (Code = 44) Position 1 = 135, Position 2 = 89
Branch analysis from position: 135
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 89
2 jumps found. (Code = 43) Position 1 = 97, Position 2 = 108
Branch analysis from position: 97
2 jumps found. (Code = 44) Position 1 = 135, Position 2 = 89
Branch analysis from position: 135
Branch analysis from position: 89
Branch analysis from position: 108
Branch analysis from position: 135
Branch analysis from position: 135
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 38
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 19
Branch analysis from position: 79
Branch analysis from position: 19
Branch analysis from position: 38
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
Branch analysis from position: 79
Branch analysis from position: 79
filename:       /in/kMAv5
function name:  auto_link
number of ops:  137
compiled vars:  !0 = $str, !1 = $type, !2 = $popup, !3 = $matches, !4 = $pop, !5 = $i, !6 = $period
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      'both'
          2        RECV_INIT                                        !2      <false>
    8     3        IS_NOT_EQUAL                                             !1, 'email'
          4      > JMPZ                                                     ~7, ->79
   10     5    >   INIT_FCALL                                               'preg_match_all'
          6        SEND_VAL                                                 '%23%28%5E%7C%5Cs%7C%5C%28%29%28%28http%28s%3F%29%3A%2F%2F%29%7C%28www%5C.%29%29%28%5Cw%2B%5B%5E%5Cs%5C%29%5C%3C%5D%2B%29%23i'
          7        SEND_VAR                                                 !0
          8        SEND_REF                                                 !3
          9        DO_ICALL                                         $8      
         10      > JMPZ                                                     $8, ->79
   12    11    >   BOOL                                             ~9      !2
         12      > JMPZ                                                     ~9, ->15
         13    >   QM_ASSIGN                                        ~10     '+target%3D%22_blank%22+'
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~10     ''
         16    >   ASSIGN                                                   !4, ~10
   14    17        ASSIGN                                                   !5, 0
         18      > JMP                                                      ->75
   16    19    >   ASSIGN                                                   !6, ''
   17    20        INIT_FCALL                                               'preg_match'
         21        SEND_VAL                                                 '%7C%5C.%24%7C'
         22        FETCH_DIM_R                                      ~14     !3, 6
         23        FETCH_DIM_R                                      ~15     ~14, !5
         24        SEND_VAL                                                 ~15
         25        DO_ICALL                                         $16     
         26      > JMPZ                                                     $16, ->38
   19    27    >   ASSIGN                                                   !6, '.'
   20    28        INIT_FCALL                                               'substr'
         29        FETCH_DIM_R                                      ~20     !3, 6
         30        FETCH_DIM_R                                      ~21     ~20, !5
         31        SEND_VAL                                                 ~21
         32        SEND_VAL                                                 0
         33        SEND_VAL                                                 -1
         34        DO_ICALL                                         $22     
         35        FETCH_DIM_W                                      $18     !3, 6
         36        ASSIGN_DIM                                               $18, !5
         37        OP_DATA                                                  $22
   23    38    >   INIT_FCALL                                               'str_replace'
         39        FETCH_DIM_R                                      ~23     !3, 0
         40        FETCH_DIM_R                                      ~24     ~23, !5
         41        SEND_VAL                                                 ~24
   24    42        FETCH_DIM_R                                      ~25     !3, 1
         43        FETCH_DIM_R                                      ~26     ~25, !5
         44        CONCAT                                           ~27     ~26, '%3Ca+href%3D%22http'
   25    45        FETCH_DIM_R                                      ~28     !3, 4
         46        FETCH_DIM_R                                      ~29     ~28, !5
         47        CONCAT                                           ~30     ~27, ~29
         48        CONCAT                                           ~31     ~30, '%3A%2F%2F'
   26    49        FETCH_DIM_R                                      ~32     !3, 5
         50        FETCH_DIM_R                                      ~33     ~32, !5
         51        CONCAT                                           ~34     ~31, ~33
   27    52        FETCH_DIM_R                                      ~35     !3, 6
         53        FETCH_DIM_R                                      ~36     ~35, !5
         54        CONCAT                                           ~37     ~34, ~36
         55        CONCAT                                           ~38     ~37, '%22'
         56        CONCAT                                           ~39     ~38, !4
         57        CONCAT                                           ~40     ~39, '%3Ehttp'
   28    58        FETCH_DIM_R                                      ~41     !3, 4
         59        FETCH_DIM_R                                      ~42     ~41, !5
         60        CONCAT                                           ~43     ~40, ~42
         61        CONCAT                                           ~44     ~43, '%3A%2F%2F'
   29    62        FETCH_DIM_R                                      ~45     !3, 5
         63        FETCH_DIM_R                                      ~46     ~45, !5
         64        CONCAT                                           ~47     ~44, ~46
   30    65        FETCH_DIM_R                                      ~48     !3, 6
         66        FETCH_DIM_R                                      ~49     ~48, !5
         67        CONCAT                                           ~50     ~47, ~49
         68        CONCAT                                           ~51     ~50, '%3C%2Fa%3E'
   31    69        CONCAT                                           ~52     ~51, !6
         70        SEND_VAL                                                 ~52
         71        SEND_VAR                                                 !0
         72        DO_ICALL                                         $53     
   23    73        ASSIGN                                                   !0, $53
   14    74        PRE_INC                                                  !5
         75    >   FETCH_DIM_R                                      ~56     !3, 0
         76        COUNT                                            ~57     ~56
         77        IS_SMALLER                                               !5, ~57
         78      > JMPNZ                                                    ~58, ->19
   36    79    >   IS_NOT_EQUAL                                             !1, 'url'
         80      > JMPZ                                                     ~59, ->135
   38    81    >   INIT_FCALL                                               'preg_match_all'
         82        SEND_VAL                                                 '%2F%28%5Ba-zA-Z0-9_%5C.%5C-%5D%2B%29%40%28%5Ba-zA-Z0-9%5C-%5D%2B%29%5C.%28%5Ba-zA-Z0-9%5C-%5C.%5D%2A%29%2Fi'
         83        SEND_VAR                                                 !0
         84        SEND_REF                                                 !3
         85        DO_ICALL                                         $60     
         86      > JMPZ                                                     $60, ->135
   40    87    >   ASSIGN                                                   !5, 0
         88      > JMP                                                      ->131
   42    89    >   ASSIGN                                                   !6, ''
   43    90        INIT_FCALL                                               'preg_match'
         91        SEND_VAL                                                 '%7C%5C.%24%7C'
         92        FETCH_DIM_R                                      ~63     !3, 3
         93        FETCH_DIM_R                                      ~64     ~63, !5
         94        SEND_VAL                                                 ~64
         95        DO_ICALL                                         $65     
         96      > JMPZ                                                     $65, ->108
   45    97    >   ASSIGN                                                   !6, '.'
   46    98        INIT_FCALL                                               'substr'
         99        FETCH_DIM_R                                      ~69     !3, 3
        100        FETCH_DIM_R                                      ~70     ~69, !5
        101        SEND_VAL                                                 ~70
        102        SEND_VAL                                                 0
        103        SEND_VAL                                                 -1
        104        DO_ICALL                                         $71     
        105        FETCH_DIM_W                                      $67     !3, 3
        106        ASSIGN_DIM                                               $67, !5
        107        OP_DATA                                                  $71
   49   108    >   INIT_FCALL                                               'str_replace'
        109        FETCH_DIM_R                                      ~72     !3, 0
        110        FETCH_DIM_R                                      ~73     ~72, !5
        111        SEND_VAL                                                 ~73
        112        INIT_FCALL_BY_NAME                                       'safe_mailto'
        113        FETCH_DIM_R                                      ~74     !3, 1
        114        FETCH_DIM_R                                      ~75     ~74, !5
        115        CONCAT                                           ~76     ~75, '%40'
        116        FETCH_DIM_R                                      ~77     !3, 2
        117        FETCH_DIM_R                                      ~78     ~77, !5
        118        CONCAT                                           ~79     ~76, ~78
        119        CONCAT                                           ~80     ~79, '.'
        120        FETCH_DIM_R                                      ~81     !3, 3
        121        FETCH_DIM_R                                      ~82     ~81, !5
        122        CONCAT                                           ~83     ~80, ~82
        123        SEND_VAL_EX                                              ~83
        124        DO_FCALL                                      0  $84     
        125        CONCAT                                           ~85     $84, !6
        126        SEND_VAL                                                 ~85
        127        SEND_VAR                                                 !0
        128        DO_ICALL                                         $86     
        129        ASSIGN                                                   !0, $86
   40   130        PRE_INC                                                  !5
        131    >   FETCH_DIM_R                                      ~89     !3, 0
        132        COUNT                                            ~90     ~89
        133        IS_SMALLER                                               !5, ~90
        134      > JMPNZ                                                    ~91, ->89
   54   135    > > RETURN                                                   !0
   55   136*     > RETURN                                                   null

End of function auto_link

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.04 ms | 1408 KiB | 21 Q