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( html_entity_decode($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/ik6Pv
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 = 19, Position 2 = 21
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ik6Pv
function name:  get_url_arg
number of ops:  23
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        INIT_FCALL                                               'html_entity_decode'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !0, $5
    5     9        INIT_FCALL                                               'parse_url'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 6
         12        DO_ICALL                                         $7      
         13        ASSIGN                                                   !2, $7
    6    14        INIT_FCALL                                               'parse_str'
         15        SEND_VAR                                                 !2
         16        SEND_REF                                                 !3
         17        DO_ICALL                                                 
    7    18      > JMPZ                                                     !1, ->21
    8    19    >   FETCH_DIM_R                                      ~10     !3, !1
         20      > RETURN                                                   ~10
    9    21    > > RETURN                                                   !3
   10    22*     > RETURN                                                   null

End of function get_url_arg

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.72 ms | 1399 KiB | 22 Q