3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "https://m.naughtyappetite.com/oth.php?dynamicpage=all_1cm_universal_light_n&ver=1"; $urlParams = array( 'source', 'transfer_to', 'ban_rm', 'pop_rm', 'txt_rm', 'zoneid', 'userid', 'userId', 'ver', 't_uod', 't_umbr', 'email', 'emlTrack', 'key', 'uniqmessageId', 'open', 'transferSource', 'cmpn', 'loc', 'cross', 'crossMask', '_cbUrl', '_disAL', '_fData', 'utm_partner', 'clkid', 'clid', 'clbid', 'safeLP', 'campaigntype', 'redirectUrl', ); $queryString = ""; function getParam($key) { $url = "http://www.thirst-more.com/2207/campaign32813?safeLP=naughty&source=www.benaughty.com&transfer_to=naughtyappetite.com&ban_rm=000748865&zoneid=4661&userId=c078c5c84f7311e79a97441ea14ed80c&key=c7eee25af7c437abaf37c460b8d1f467&clid=927&clbid=33872&location=UKR&remType=Banner&targetSite=6747c8fb5b73abce100992b51af15eef"; $query = parse_url($url, PHP_URL_QUERY); parse_str($query, $params); return isset($params[$key]) ? $params[$key] : null; } $params = array_fill_keys($urlParams, ""); array_walk($params, function(&$item, $key){ $item = getParam($key); }); $params = array_filter($params); if (!empty($params)) { $queryString = http_build_query($params); } if (empty($queryString)) return $url; $pos = strrpos($url,"?"); die(var_dump($url . ( $pos === false ? "?" : "&" ) . $queryString, $queryString, $params));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 27
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 37
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 24
filename:       /in/uAtSC
function name:  (null)
number of ops:  46
compiled vars:  !0 = $url, !1 = $urlParams, !2 = $queryString, !3 = $params, !4 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'https%3A%2F%2Fm.naughtyappetite.com%2Foth.php%3Fdynamicpage%3Dall_1cm_universal_light_n%26ver%3D1'
    3     1        ASSIGN                                                   !1, <array>
   37     2        ASSIGN                                                   !2, ''
   46     3        INIT_FCALL                                               'array_fill_keys'
          4        SEND_VAR                                                 !1
          5        SEND_VAL                                                 ''
          6        DO_ICALL                                         $8      
          7        ASSIGN                                                   !3, $8
   47     8        INIT_FCALL                                               'array_walk'
          9        SEND_REF                                                 !3
         10        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FuAtSC%3A47%240'
   49    11        SEND_VAL                                                 ~10
         12        DO_ICALL                                                 
   50    13        INIT_FCALL                                               'array_filter'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !3, $12
   52    17        ISSET_ISEMPTY_CV                                 ~14     !3
         18        BOOL_NOT                                         ~15     ~14
         19      > JMPZ                                                     ~15, ->24
   53    20    >   INIT_FCALL                                               'http_build_query'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $16     
         23        ASSIGN                                                   !2, $16
   56    24    >   ISSET_ISEMPTY_CV                                         !2
         25      > JMPZ                                                     ~18, ->27
   57    26    > > RETURN                                                   !0
   59    27    >   INIT_FCALL                                               'strrpos'
         28        SEND_VAR                                                 !0
         29        SEND_VAL                                                 '%3F'
         30        DO_ICALL                                         $19     
         31        ASSIGN                                                   !4, $19
   61    32        INIT_FCALL                                               'var_dump'
         33        TYPE_CHECK                                    4          !4
         34      > JMPZ                                                     ~21, ->37
         35    >   QM_ASSIGN                                        ~22     '%3F'
         36      > JMP                                                      ->38
         37    >   QM_ASSIGN                                        ~22     '%26'
         38    >   CONCAT                                           ~23     !0, ~22
         39        CONCAT                                           ~24     ~23, !2
         40        SEND_VAL                                                 ~24
         41        SEND_VAR                                                 !2
         42        SEND_VAR                                                 !3
         43        DO_ICALL                                         $25     
         44      > EXIT                                                     $25
         45*     > RETURN                                                   1

Function getparam:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uAtSC
function name:  getParam
number of ops:  19
compiled vars:  !0 = $key, !1 = $url, !2 = $query, !3 = $params
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   39     0  E >   RECV                                             !0      
   40     1        ASSIGN                                                   !1, 'http%3A%2F%2Fwww.thirst-more.com%2F2207%2Fcampaign32813%3FsafeLP%3Dnaughty%26source%3Dwww.benaughty.com%26transfer_to%3Dnaughtyappetite.com%26ban_rm%3D000748865%26zoneid%3D4661%26userId%3Dc078c5c84f7311e79a97441ea14ed80c%26key%3Dc7eee25af7c437abaf37c460b8d1f467%26clid%3D927%26clbid%3D33872%26location%3DUKR%26remType%3DBanner%26targetSite%3D6747c8fb5b73abce100992b51af15eef'
   41     2        INIT_FCALL                                               'parse_url'
          3        SEND_VAR                                                 !1
          4        SEND_VAL                                                 6
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
   42     7        INIT_FCALL                                               'parse_str'
          8        SEND_VAR                                                 !2
          9        SEND_REF                                                 !3
         10        DO_ICALL                                                 
   43    11        ISSET_ISEMPTY_DIM_OBJ                         0          !3, !0
         12      > JMPZ                                                     ~8, ->16
         13    >   FETCH_DIM_R                                      ~9      !3, !0
         14        QM_ASSIGN                                        ~10     ~9
         15      > JMP                                                      ->17
         16    >   QM_ASSIGN                                        ~10     null
         17    > > RETURN                                                   ~10
   44    18*     > RETURN                                                   null

End of function getparam

Function %00%7Bclosure%7D%2Fin%2FuAtSC%3A47%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uAtSC
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $item, !1 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   47     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   48     2        INIT_FCALL                                               'getparam'
          3        SEND_VAR                                                 !1
          4        DO_FCALL                                      0  $2      
          5        ASSIGN                                                   !0, $2
   49     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FuAtSC%3A47%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.13 ms | 1407 KiB | 30 Q