3v4l.org

run code in 300+ PHP versions simultaneously
<?php $addr = "http://www.example.com/?pk_lol=VAgin&utm_campaign=printemps&utm_medium=e-mail&utm_source=newsletter1&utm_content=lien-en-haut"; $source = array ('utm_campaign=', 'utm_medium=', 'utm_source='); $pattern ="/({$source[0]}.[^&]+)&({$source[1]}.[^&]+)&({$source[2]}.[^&]+)&/"; preg_match($pattern, $addr, $result); foreach (range(0,2) as $i) { echo "{$i}: ".substr($result[$i+1], strlen($source[$i]))."\n"; } print_r($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 38
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 38
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
filename:       /in/8hb9r
function name:  (null)
number of ops:  43
compiled vars:  !0 = $addr, !1 = $source, !2 = $pattern, !3 = $result, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     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'
    4     1        ASSIGN                                                   !1, <array>
    5     2        ROPE_INIT                                     7  ~11     '%2F%28'
          3        FETCH_DIM_R                                      ~7      !1, 0
          4        ROPE_ADD                                      1  ~11     ~11, ~7
          5        ROPE_ADD                                      2  ~11     ~11, '.%5B%5E%26%5D%2B%29%26%28'
          6        FETCH_DIM_R                                      ~8      !1, 1
          7        ROPE_ADD                                      3  ~11     ~11, ~8
          8        ROPE_ADD                                      4  ~11     ~11, '.%5B%5E%26%5D%2B%29%26%28'
          9        FETCH_DIM_R                                      ~9      !1, 2
         10        ROPE_ADD                                      5  ~11     ~11, ~9
         11        ROPE_END                                      6  ~10     ~11, '.%5B%5E%26%5D%2B%29%26%2F'
         12        ASSIGN                                                   !2, ~10
    8    13        INIT_FCALL                                               'preg_match'
         14        SEND_VAR                                                 !2
         15        SEND_VAR                                                 !0
         16        SEND_REF                                                 !3
         17        DO_ICALL                                                 
   10    18        INIT_FCALL                                               'range'
         19        SEND_VAL                                                 0
         20        SEND_VAL                                                 2
         21        DO_ICALL                                         $17     
         22      > FE_RESET_R                                       $18     $17, ->38
         23    > > FE_FETCH_R                                               $18, !4, ->38
   12    24    >   NOP                                                      
         25        FAST_CONCAT                                      ~19     !4, '%3A+'
         26        INIT_FCALL                                               'substr'
         27        ADD                                              ~20     !4, 1
         28        FETCH_DIM_R                                      ~21     !3, ~20
         29        SEND_VAL                                                 ~21
         30        FETCH_DIM_R                                      ~22     !1, !4
         31        STRLEN                                           ~23     ~22
         32        SEND_VAL                                                 ~23
         33        DO_ICALL                                         $24     
         34        CONCAT                                           ~25     ~19, $24
         35        CONCAT                                           ~26     ~25, '%0A'
         36        ECHO                                                     ~26
   10    37      > JMP                                                      ->23
         38    >   FE_FREE                                                  $18
   15    39        INIT_FCALL                                               'print_r'
         40        SEND_VAR                                                 !3
         41        DO_ICALL                                                 
         42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.76 ms | 1400 KiB | 21 Q