3v4l.org

run code in 300+ PHP versions simultaneously
<?php $addr = "http://10.0.0.4/?rdm_tag=1&utm_source=source1&utm_medium=medium1&pk_tag=123&utm_campaign=campaign1"; // Parse the url. $tableName = array ('referer_medium', 'referer_source', 'referer_campaign'); $tags = array ('utm_medium=', 'utm_source=', 'utm_campaign='); $visitorInfo = array( 'foo' => 'foo', 'referer_medium' => '', 'bar' => 'bar', 'referer_source' => '', 'referer_campaign' => '', 'answer' => '42' ); $results = explode("&", explode("?", $addr)[1]); print_r($results); foreach($results as $result){ foreach($tags as $key => $tag) { if (($offset = stripos($result, $tag)) !== false) { $visitorInfo["$tableName[$key]}"] = substr($result, strlen($tag)); } } } print_r($visitorInfo); //foreach ($tags as $key => $tag){ // $visitorInfo["{$tableName[$key]}"] = $_GET["{$tag}"]; //}
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 42
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 42
Branch analysis from position: 19
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 40
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 40
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 39
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 39
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 40
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
filename:       /in/RJYWb
function name:  (null)
number of ops:  47
compiled vars:  !0 = $addr, !1 = $tableName, !2 = $tags, !3 = $visitorInfo, !4 = $results, !5 = $result, !6 = $tag, !7 = $key, !8 = $offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2F10.0.0.4%2F%3Frdm_tag%3D1%26utm_source%3Dsource1%26utm_medium%3Dmedium1%26pk_tag%3D123%26utm_campaign%3Dcampaign1'
    5     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN                                                   !2, <array>
    7     3        ASSIGN                                                   !3, <array>
   16     4        INIT_FCALL                                               'explode'
          5        SEND_VAL                                                 '%26'
          6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '%3F'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $13     
         10        FETCH_DIM_R                                      ~14     $13, 1
         11        SEND_VAL                                                 ~14
         12        DO_ICALL                                         $15     
         13        ASSIGN                                                   !4, $15
   18    14        INIT_FCALL                                               'print_r'
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                                 
   20    17      > FE_RESET_R                                       $18     !4, ->42
         18    > > FE_FETCH_R                                               $18, !5, ->42
   21    19    > > FE_RESET_R                                       $19     !2, ->40
         20    > > FE_FETCH_R                                       ~20     $19, !6, ->40
         21    >   ASSIGN                                                   !7, ~20
   22    22        INIT_FCALL                                               'stripos'
         23        SEND_VAR                                                 !5
         24        SEND_VAR                                                 !6
         25        DO_ICALL                                         $22     
         26        ASSIGN                                           ~23     !8, $22
         27        TYPE_CHECK                                  1018          ~23
         28      > JMPZ                                                     ~24, ->39
   24    29    >   FETCH_DIM_R                                      ~25     !1, !7
         30        NOP                                                      
         31        FAST_CONCAT                                      ~26     ~25, '%7D'
         32        INIT_FCALL                                               'substr'
         33        SEND_VAR                                                 !5
         34        STRLEN                                           ~28     !6
         35        SEND_VAL                                                 ~28
         36        DO_ICALL                                         $29     
         37        ASSIGN_DIM                                               !3, ~26
         38        OP_DATA                                                  $29
   21    39    > > JMP                                                      ->20
         40    >   FE_FREE                                                  $19
   20    41      > JMP                                                      ->18
         42    >   FE_FREE                                                  $18
   29    43        INIT_FCALL                                               'print_r'
         44        SEND_VAR                                                 !3
         45        DO_ICALL                                                 
   33    46      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.81 ms | 1392 KiB | 21 Q