3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Parse the url. $addr = "http://www.example.com/?pk_lol=VAgin&utm_campaign=printemps&utm_medium=e-mail&utm_source=newsletter1&utm_content=lien-en-haut"; $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); $lol = sprintf(); 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 = 27, Position 2 = 41
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 41
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
filename:       /in/OSMKp
function name:  (null)
number of ops:  46
compiled vars:  !0 = $addr, !1 = $tableName, !2 = $source, !3 = $pattern, !4 = $result, !5 = $lol, !6 = $i, !7 = $visitorInfo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fwww.example.com%2F%3Fpk_lol%3DVAgin%26utm_campaign%3Dprintemps%26utm_medium%3De-mail%26utm_source%3Dnewsletter1%26utm_content%3Dlien-en-haut'
    6     1        ASSIGN                                                   !1, <array>
    7     2        ASSIGN                                                   !2, <array>
    8     3        ROPE_INIT                                     7  ~15     '%2F%28'
          4        FETCH_DIM_R                                      ~11     !2, 0
          5        ROPE_ADD                                      1  ~15     ~15, ~11
          6        ROPE_ADD                                      2  ~15     ~15, '.%5B%5E%26%5D%2B%29%26%28'
          7        FETCH_DIM_R                                      ~12     !2, 1
          8        ROPE_ADD                                      3  ~15     ~15, ~12
          9        ROPE_ADD                                      4  ~15     ~15, '.%5B%5E%26%5D%2B%29%26%28'
         10        FETCH_DIM_R                                      ~13     !2, 2
         11        ROPE_ADD                                      5  ~15     ~15, ~13
         12        ROPE_END                                      6  ~14     ~15, '.%5B%5E%26%5D%2B%29%26%2F'
         13        ASSIGN                                                   !3, ~14
   10    14        INIT_FCALL                                               'preg_match'
         15        SEND_VAR                                                 !3
         16        SEND_VAR                                                 !0
         17        SEND_REF                                                 !4
         18        DO_ICALL                                                 
   12    19        INIT_FCALL                                               'sprintf'
         20        DO_ICALL                                         $21     
         21        ASSIGN                                                   !5, $21
   14    22        INIT_FCALL                                               'range'
         23        SEND_VAL                                                 0
         24        SEND_VAL                                                 2
         25        DO_ICALL                                         $23     
         26      > FE_RESET_R                                       $24     $23, ->41
         27    > > FE_FETCH_R                                               $24, !6, ->41
   15    28    >   FETCH_DIM_R                                      ~25     !1, !6
         29        CAST                                          6  ~26     ~25
         30        INIT_FCALL                                               'substr'
         31        ADD                                              ~28     !6, 1
         32        FETCH_DIM_R                                      ~29     !4, ~28
         33        SEND_VAL                                                 ~29
         34        FETCH_DIM_R                                      ~30     !2, !6
         35        STRLEN                                           ~31     ~30
         36        SEND_VAL                                                 ~31
         37        DO_ICALL                                         $32     
         38        ASSIGN_DIM                                               !7, ~26
         39        OP_DATA                                                  $32
   14    40      > JMP                                                      ->27
         41    >   FE_FREE                                                  $24
   18    42        INIT_FCALL                                               'print_r'
         43        SEND_VAR                                                 !7
         44        DO_ICALL                                                 
         45      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.54 ms | 1400 KiB | 23 Q