3v4l.org

run code in 300+ PHP versions simultaneously
<?php function custom_parse_url($url, $dummy_scheme = '') { if (version_compare(phpversion(), '7.0.0beta1') < 0) { $url_parts = parse_url($dummy_scheme.$url); if (isset($url_parts['scheme']) && $url_parts['scheme'] == $dummy_scheme) { unset($url_parts['scheme']); } return $url_parts; } else { return parse_url($url); } } $url = "_search?q=sku:89399"; var_dump(custom_parse_url($url, 'test://'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PdOsj
function name:  (null)
number of ops:  9
compiled vars:  !0 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                   !0, '_search%3Fq%3Dsku%3A89399'
   17     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'custom_parse_url'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 'test%3A%2F%2F'
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR                                                 $2
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function custom_parse_url:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 20
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/PdOsj
function name:  custom_parse_url
number of ops:  29
compiled vars:  !0 = $url, !1 = $dummy_scheme, !2 = $url_parts
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      ''
    3     2        INIT_FCALL                                               'version_compare'
          3        INIT_FCALL                                               'phpversion'
          4        DO_ICALL                                         $3      
          5        SEND_VAR                                                 $3
          6        SEND_VAL                                                 '7.0.0beta1'
          7        DO_ICALL                                         $4      
          8        IS_SMALLER                                               $4, 0
          9      > JMPZ                                                     ~5, ->24
    4    10    >   INIT_FCALL                                               'parse_url'
         11        CONCAT                                           ~6      !1, !0
         12        SEND_VAL                                                 ~6
         13        DO_ICALL                                         $7      
         14        ASSIGN                                                   !2, $7
    6    15        ISSET_ISEMPTY_DIM_OBJ                         0  ~9      !2, 'scheme'
         16      > JMPZ_EX                                          ~9      ~9, ->20
         17    >   FETCH_DIM_R                                      ~10     !2, 'scheme'
         18        IS_EQUAL                                         ~11     !1, ~10
         19        BOOL                                             ~9      ~11
         20    > > JMPZ                                                     ~9, ->22
    7    21    >   UNSET_DIM                                                !2, 'scheme'
   10    22    > > RETURN                                                   !2
         23*       JMP                                                      ->28
   12    24    >   INIT_FCALL                                               'parse_url'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $12     
         27      > RETURN                                                   $12
   14    28*     > RETURN                                                   null

End of function custom_parse_url

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.56 ms | 1394 KiB | 22 Q