3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * http://domain.com/?referal=athimmo * * Return only the broker image from the referal. * @return string */ function ldl_generate_referal_page() { $url="//".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $parts = parse_url($url); parse_str($parts['query'], $query); if(!empty($query)) { $broker = $query['referal']; switch ($broker) { case 'dewaele'; add_filter('body_class', function( $classes ) { return array_merge( $classes, array('dewaele') ); }); break; case 'urbis'; add_filter('body_class', function( $classes ) { return array_merge( $classes, array('urbis') ); }); break; default : add_filter('body_class', function( $classes ) { return array_merge( $classes, array('all_brokers') ); }); } } } ldl_generate_referal_page();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4KsZ1
function name:  (null)
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   INIT_FCALL                                               'ldl_generate_referal_page'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   1

Function ldl_generate_referal_page:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 44
Branch analysis from position: 19
4 jumps found. (Code = 188) Position 1 = 27, Position 2 = 33, Position 3 = 39, Position 4 = 22
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 33
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 39
Branch analysis from position: 39
Branch analysis from position: 33
Branch analysis from position: 27
Branch analysis from position: 44
filename:       /in/4KsZ1
function name:  ldl_generate_referal_page
number of ops:  45
compiled vars:  !0 = $url, !1 = $parts, !2 = $query, !3 = $broker
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   FETCH_R                      global              ~4      '_SERVER'
          1        FETCH_DIM_R                                      ~5      ~4, 'HTTP_HOST'
          2        CONCAT                                           ~6      '%2F%2F', ~5
          3        FETCH_R                      global              ~7      '_SERVER'
          4        FETCH_DIM_R                                      ~8      ~7, 'REQUEST_URI'
          5        CONCAT                                           ~9      ~6, ~8
          6        ASSIGN                                                   !0, ~9
   13     7        INIT_FCALL                                               'parse_url'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $11     
         10        ASSIGN                                                   !1, $11
   14    11        INIT_FCALL                                               'parse_str'
         12        FETCH_DIM_R                                      ~13     !1, 'query'
         13        SEND_VAL                                                 ~13
         14        SEND_REF                                                 !2
         15        DO_ICALL                                                 
   16    16        ISSET_ISEMPTY_CV                                 ~15     !2
         17        BOOL_NOT                                         ~16     ~15
         18      > JMPZ                                                     ~16, ->44
   17    19    >   FETCH_DIM_R                                      ~17     !2, 'referal'
         20        ASSIGN                                                   !3, ~17
   19    21      > SWITCH_STRING                                            !3, [ 'dewaele':->27, 'urbis':->33, ], ->39
   20    22    >   IS_EQUAL                                                 !3, 'dewaele'
         23      > JMPNZ                                                    ~19, ->27
   26    24    >   IS_EQUAL                                                 !3, 'urbis'
         25      > JMPNZ                                                    ~19, ->33
         26    > > JMP                                                      ->39
   21    27    >   INIT_FCALL_BY_NAME                                       'add_filter'
         28        SEND_VAL_EX                                              'body_class'
         29        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4KsZ1%3A21%240'
   23    30        SEND_VAL_EX                                              ~20
         31        DO_FCALL                                      0          
   24    32      > JMP                                                      ->44
   27    33    >   INIT_FCALL_BY_NAME                                       'add_filter'
         34        SEND_VAL_EX                                              'body_class'
         35        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4KsZ1%3A27%241'
   29    36        SEND_VAL_EX                                              ~22
         37        DO_FCALL                                      0          
   30    38      > JMP                                                      ->44
   33    39    >   INIT_FCALL_BY_NAME                                       'add_filter'
         40        SEND_VAL_EX                                              'body_class'
         41        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F4KsZ1%3A33%242'
   35    42        SEND_VAL_EX                                              ~24
         43        DO_FCALL                                      0          
   39    44    > > RETURN                                                   null

End of function ldl_generate_referal_page

Function %00%7Bclosure%7D%2Fin%2F4KsZ1%3A21%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4KsZ1
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $classes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
   22     1        INIT_FCALL                                               'array_merge'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   23     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4KsZ1%3A21%240

Function %00%7Bclosure%7D%2Fin%2F4KsZ1%3A27%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4KsZ1
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $classes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   28     1        INIT_FCALL                                               'array_merge'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   29     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4KsZ1%3A27%241

Function %00%7Bclosure%7D%2Fin%2F4KsZ1%3A33%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4KsZ1
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $classes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   RECV                                             !0      
   34     1        INIT_FCALL                                               'array_merge'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                         $1      
          5      > RETURN                                                   $1
   35     6*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F4KsZ1%3A33%242

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.86 ms | 1406 KiB | 20 Q