3v4l.org

run code in 300+ PHP versions simultaneously
<?php function wp_parse_url( $url ) { // TODO; Move to wp_parse_url() ? // Prefix with a temporary placeholder scheme for scheme-less URL's to work around PHP Bugs if ( preg_match( '~^//~', $url ) ) { $url = "wp-placeholder:$url"; } if ( preg_match( '~^/[^/]~', $url ) ) { $url = "wp-placeholder://wp-placeholder$url"; } if ( preg_match( '~^[^/]+://.+@[^/]+$~', $url ) ) { $url .= '/'; } $parts = @parse_url( $url ); if ( $parts ) { $parts['url'] = $url; } foreach ( array( 'scheme', 'host' ) as $component ) { if ( isset( $parts[ $component ] ) && 'wp-placeholder' === $parts[ $component ] ) { unset( $parts[ $component ] ); } } return $parts; } var_export(wp_parse_url( '//some-host.com/?url=http://whatever/' ));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qeC2F
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   INIT_FCALL                                               'var_export'
          1        INIT_FCALL                                               'wp_parse_url'
          2        SEND_VAL                                                 '%2F%2Fsome-host.com%2F%3Furl%3Dhttp%3A%2F%2Fwhatever%2F'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
          6      > RETURN                                                   1

Function wp_parse_url:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 42
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 42
Branch analysis from position: 34
2 jumps found. (Code = 46) Position 1 = 36, Position 2 = 39
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 41
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 41
Branch analysis from position: 39
Branch analysis from position: 42
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 42
Branch analysis from position: 32
Branch analysis from position: 23
Branch analysis from position: 17
Branch analysis from position: 9
filename:       /in/qeC2F
function name:  wp_parse_url
number of ops:  45
compiled vars:  !0 = $url, !1 = $parts, !2 = $component
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%7E%5E%2F%2F%7E'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $3      
          5      > JMPZ                                                     $3, ->9
    7     6    >   NOP                                                      
          7        FAST_CONCAT                                      ~4      'wp-placeholder%3A', !0
          8        ASSIGN                                                   !0, ~4
   10     9    >   INIT_FCALL                                               'preg_match'
         10        SEND_VAL                                                 '%7E%5E%2F%5B%5E%2F%5D%7E'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $6      
         13      > JMPZ                                                     $6, ->17
   11    14    >   NOP                                                      
         15        FAST_CONCAT                                      ~7      'wp-placeholder%3A%2F%2Fwp-placeholder', !0
         16        ASSIGN                                                   !0, ~7
   14    17    >   INIT_FCALL                                               'preg_match'
         18        SEND_VAL                                                 '%7E%5E%5B%5E%2F%5D%2B%3A%2F%2F.%2B%40%5B%5E%2F%5D%2B%24%7E'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                         $9      
         21      > JMPZ                                                     $9, ->23
   15    22    >   ASSIGN_OP                                     8          !0, '%2F'
   18    23    >   BEGIN_SILENCE                                    ~11     
         24        INIT_FCALL                                               'parse_url'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $12     
         27        END_SILENCE                                              ~11
         28        ASSIGN                                                   !1, $12
   19    29      > JMPZ                                                     !1, ->32
         30    >   ASSIGN_DIM                                               !1, 'url'
         31        OP_DATA                                                  !0
   20    32    > > FE_RESET_R                                       $15     <array>, ->42
         33    > > FE_FETCH_R                                               $15, !2, ->42
   21    34    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~16     !1, !2
         35      > JMPZ_EX                                          ~16     ~16, ->39
         36    >   FETCH_DIM_R                                      ~17     !1, !2
         37        IS_IDENTICAL                                     ~18     ~17, 'wp-placeholder'
         38        BOOL                                             ~16     ~18
         39    > > JMPZ                                                     ~16, ->41
   22    40    >   UNSET_DIM                                                !1, !2
   20    41    > > JMP                                                      ->33
         42    >   FE_FREE                                                  $15
   26    43      > RETURN                                                   !1
   27    44*     > RETURN                                                   null

End of function wp_parse_url

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.63 ms | 1394 KiB | 20 Q