3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! function get_url_arg( $url,$arg='' ) { $url = urldecode( $url ); $args = parse_url( $url, PHP_URL_QUERY ); parse_str( $args, $result ); if($arg) return $result[$arg]; return $result; } $url = 'http://click.union.jd.com/statistic/statisticClick.action?unionId=18550&amp;t=1&amp;to=http://item.jd.com/634519.html'; echo get_url_arg($url,'to');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QgH8V
function name:  (null)
number of ops:  7
compiled vars:  !0 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fclick.union.jd.com%2Fstatistic%2FstatisticClick.action%3FunionId%3D18550%26amp%3Bt%3D1%26amp%3Bto%3Dhttp%3A%2F%2Fitem.jd.com%2F634519.html'
   12     1        INIT_FCALL                                               'get_url_arg'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'to'
          4        DO_FCALL                                      0  $2      
          5        ECHO                                                     $2
          6      > RETURN                                                   1

Function get_url_arg:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QgH8V
function name:  get_url_arg
number of ops:  20
compiled vars:  !0 = $url, !1 = $arg, !2 = $args, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
    4     2        INIT_FCALL                                               'urldecode'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !0, $4
    5     6        INIT_FCALL                                               'parse_url'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 6
          9        DO_ICALL                                         $6      
         10        ASSIGN                                                   !2, $6
    6    11        INIT_FCALL                                               'parse_str'
         12        SEND_VAR                                                 !2
         13        SEND_REF                                                 !3
         14        DO_ICALL                                                 
    7    15      > JMPZ                                                     !1, ->18
    8    16    >   FETCH_DIM_R                                      ~9      !3, !1
         17      > RETURN                                                   ~9
    9    18    > > RETURN                                                   !3
   10    19*     > RETURN                                                   null

End of function get_url_arg

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.29 ms | 1399 KiB | 20 Q