3v4l.org

run code in 300+ PHP versions simultaneously
<?php $addr = "http://10.0.0.4/?utm_source=source1&utm_medium=medium1&utm_campaign=campaign1"; // Parse the url. $tableName = array ('referer_medium', 'referer_source', 'referer_campaign'); $source = array ('utm_campaign=', 'utm_medium=', 'utm_source='); $pattern ="/({$source[0]}.[^&]+)&({$source[1]}.[^&]+)&({$source[2]}.[^&]+)&/"; preg_match($pattern, $addr, $result); // Add the values to the log_visit table. foreach (range(0,2) as $i) { $visitorInfo["{$tableName[$i]}"] = substr($result[$i+1], strlen($source[$i])); } print_r ($visitorInfo);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 38
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 38
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/9U6RY
function name:  (null)
number of ops:  43
compiled vars:  !0 = $addr, !1 = $tableName, !2 = $source, !3 = $pattern, !4 = $result, !5 = $i, !6 = $visitorInfo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2F10.0.0.4%2F%3Futm_source%3Dsource1%26utm_medium%3Dmedium1%26utm_campaign%3Dcampaign1'
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, <array>
    6     3        ROPE_INIT                                     7  ~14     '%2F%28'
          4        FETCH_DIM_R                                      ~10     !2, 0
          5        ROPE_ADD                                      1  ~14     ~14, ~10
          6        ROPE_ADD                                      2  ~14     ~14, '.%5B%5E%26%5D%2B%29%26%28'
          7        FETCH_DIM_R                                      ~11     !2, 1
          8        ROPE_ADD                                      3  ~14     ~14, ~11
          9        ROPE_ADD                                      4  ~14     ~14, '.%5B%5E%26%5D%2B%29%26%28'
         10        FETCH_DIM_R                                      ~12     !2, 2
         11        ROPE_ADD                                      5  ~14     ~14, ~12
         12        ROPE_END                                      6  ~13     ~14, '.%5B%5E%26%5D%2B%29%26%2F'
         13        ASSIGN                                                   !3, ~13
    7    14        INIT_FCALL                                               'preg_match'
         15        SEND_VAR                                                 !3
         16        SEND_VAR                                                 !0
         17        SEND_REF                                                 !4
         18        DO_ICALL                                                 
   10    19        INIT_FCALL                                               'range'
         20        SEND_VAL                                                 0
         21        SEND_VAL                                                 2
         22        DO_ICALL                                         $20     
         23      > FE_RESET_R                                       $21     $20, ->38
         24    > > FE_FETCH_R                                               $21, !5, ->38
   11    25    >   FETCH_DIM_R                                      ~22     !1, !5
         26        CAST                                          6  ~23     ~22
         27        INIT_FCALL                                               'substr'
         28        ADD                                              ~25     !5, 1
         29        FETCH_DIM_R                                      ~26     !4, ~25
         30        SEND_VAL                                                 ~26
         31        FETCH_DIM_R                                      ~27     !2, !5
         32        STRLEN                                           ~28     ~27
         33        SEND_VAL                                                 ~28
         34        DO_ICALL                                         $29     
         35        ASSIGN_DIM                                               !6, ~23
         36        OP_DATA                                                  $29
   10    37      > JMP                                                      ->24
         38    >   FE_FREE                                                  $21
   13    39        INIT_FCALL                                               'print_r'
         40        SEND_VAR                                                 !6
         41        DO_ICALL                                                 
         42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.98 ms | 1392 KiB | 21 Q