3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (PHP_VERSION != '5.3.6') { die("Incorrect version"); } function a($url) { preg_match('!(?:(\w+)://)?(?:(\w+)\:(\w+)@)?([^/:]+)?(?:\:(\d*))?([^#?]+)?(?:\?([^#]+))?(?:#(.+$))?!i', $url, $out); return $out; } function b($url) { $out = parse_url($url); return $out; } $i = 100000; $start = microtime(true); while (--$i) { $u[1] = a('example.com'); $u[2] = a('example.com/index.php'); $u[3] = a('example.com?foo=bar'); $u[4] = a('/index.php'); $u[5] = a('/index.php?foo=bar'); $u[6] = a('?foo=bar'); } print_r($u); echo microtime(true) - $start . "\n"; $i = 100000; $start = microtime(true); while (--$i) { $u[1] = b('example.com'); $u[2] = b('example.com/index.php'); $u[3] = b('example.com?foo=bar'); $u[4] = b('/index.php'); $u[5] = b('/index.php?foo=bar'); $u[6] = b('?foo=bar'); } print_r($u); echo microtime(true) - $start . "\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 1, Position 2 = 2
Branch analysis from position: 1
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 8
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
2 jumps found. (Code = 44) Position 1 = 87, Position 2 = 55
Branch analysis from position: 87
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
2 jumps found. (Code = 44) Position 1 = 87, Position 2 = 55
Branch analysis from position: 87
Branch analysis from position: 55
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 8
Branch analysis from position: 40
Branch analysis from position: 8
filename:       /in/FsT6Y
function name:  (null)
number of ops:  97
compiled vars:  !0 = $i, !1 = $start, !2 = $u
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E > > JMPZ                                                     <true>, ->2
    4     1    > > EXIT                                                     'Incorrect+version'
   19     2    >   ASSIGN                                                   !0, 100000
   20     3        INIT_FCALL                                               'microtime'
          4        SEND_VAL                                                 <true>
          5        DO_ICALL                                         $4      
          6        ASSIGN                                                   !1, $4
   21     7      > JMP                                                      ->38
   22     8    >   INIT_FCALL                                               'a'
          9        SEND_VAL                                                 'example.com'
         10        DO_FCALL                                      0  $7      
         11        ASSIGN_DIM                                               !2, 1
         12        OP_DATA                                                  $7
   23    13        INIT_FCALL                                               'a'
         14        SEND_VAL                                                 'example.com%2Findex.php'
         15        DO_FCALL                                      0  $9      
         16        ASSIGN_DIM                                               !2, 2
         17        OP_DATA                                                  $9
   24    18        INIT_FCALL                                               'a'
         19        SEND_VAL                                                 'example.com%3Ffoo%3Dbar'
         20        DO_FCALL                                      0  $11     
         21        ASSIGN_DIM                                               !2, 3
         22        OP_DATA                                                  $11
   25    23        INIT_FCALL                                               'a'
         24        SEND_VAL                                                 '%2Findex.php'
         25        DO_FCALL                                      0  $13     
         26        ASSIGN_DIM                                               !2, 4
         27        OP_DATA                                                  $13
   26    28        INIT_FCALL                                               'a'
         29        SEND_VAL                                                 '%2Findex.php%3Ffoo%3Dbar'
         30        DO_FCALL                                      0  $15     
         31        ASSIGN_DIM                                               !2, 5
         32        OP_DATA                                                  $15
   27    33        INIT_FCALL                                               'a'
         34        SEND_VAL                                                 '%3Ffoo%3Dbar'
         35        DO_FCALL                                      0  $17     
         36        ASSIGN_DIM                                               !2, 6
         37        OP_DATA                                                  $17
   21    38    >   PRE_DEC                                          ~18     !0
         39      > JMPNZ                                                    ~18, ->8
   29    40    >   INIT_FCALL                                               'print_r'
         41        SEND_VAR                                                 !2
         42        DO_ICALL                                                 
   30    43        INIT_FCALL                                               'microtime'
         44        SEND_VAL                                                 <true>
         45        DO_ICALL                                         $20     
         46        SUB                                              ~21     $20, !1
         47        CONCAT                                           ~22     ~21, '%0A'
         48        ECHO                                                     ~22
   32    49        ASSIGN                                                   !0, 100000
   33    50        INIT_FCALL                                               'microtime'
         51        SEND_VAL                                                 <true>
         52        DO_ICALL                                         $24     
         53        ASSIGN                                                   !1, $24
   34    54      > JMP                                                      ->85
   35    55    >   INIT_FCALL                                               'b'
         56        SEND_VAL                                                 'example.com'
         57        DO_FCALL                                      0  $27     
         58        ASSIGN_DIM                                               !2, 1
         59        OP_DATA                                                  $27
   36    60        INIT_FCALL                                               'b'
         61        SEND_VAL                                                 'example.com%2Findex.php'
         62        DO_FCALL                                      0  $29     
         63        ASSIGN_DIM                                               !2, 2
         64        OP_DATA                                                  $29
   37    65        INIT_FCALL                                               'b'
         66        SEND_VAL                                                 'example.com%3Ffoo%3Dbar'
         67        DO_FCALL                                      0  $31     
         68        ASSIGN_DIM                                               !2, 3
         69        OP_DATA                                                  $31
   38    70        INIT_FCALL                                               'b'
         71        SEND_VAL                                                 '%2Findex.php'
         72        DO_FCALL                                      0  $33     
         73        ASSIGN_DIM                                               !2, 4
         74        OP_DATA                                                  $33
   39    75        INIT_FCALL                                               'b'
         76        SEND_VAL                                                 '%2Findex.php%3Ffoo%3Dbar'
         77        DO_FCALL                                      0  $35     
         78        ASSIGN_DIM                                               !2, 5
         79        OP_DATA                                                  $35
   40    80        INIT_FCALL                                               'b'
         81        SEND_VAL                                                 '%3Ffoo%3Dbar'
         82        DO_FCALL                                      0  $37     
         83        ASSIGN_DIM                                               !2, 6
         84        OP_DATA                                                  $37
   34    85    >   PRE_DEC                                          ~38     !0
         86      > JMPNZ                                                    ~38, ->55
   42    87    >   INIT_FCALL                                               'print_r'
         88        SEND_VAR                                                 !2
         89        DO_ICALL                                                 
   43    90        INIT_FCALL                                               'microtime'
         91        SEND_VAL                                                 <true>
         92        DO_ICALL                                         $40     
         93        SUB                                              ~41     $40, !1
         94        CONCAT                                           ~42     ~41, '%0A'
         95        ECHO                                                     ~42
         96      > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FsT6Y
function name:  a
number of ops:  8
compiled vars:  !0 = $url, !1 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    9     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%21%28%3F%3A%28%5Cw%2B%29%3A%2F%2F%29%3F%28%3F%3A%28%5Cw%2B%29%5C%3A%28%5Cw%2B%29%40%29%3F%28%5B%5E%2F%3A%5D%2B%29%3F%28%3F%3A%5C%3A%28%5Cd%2A%29%29%3F%28%5B%5E%23%3F%5D%2B%29%3F%28%3F%3A%5C%3F%28%5B%5E%23%5D%2B%29%29%3F%28%3F%3A%23%28.%2B%24%29%29%3F%21i'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
   10     6      > RETURN                                                   !1
   11     7*     > RETURN                                                   null

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FsT6Y
function name:  b
number of ops:  7
compiled vars:  !0 = $url, !1 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        INIT_FCALL                                               'parse_url'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $2      
          4        ASSIGN                                                   !1, $2
   16     5      > RETURN                                                   !1
   17     6*     > RETURN                                                   null

End of function b

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.1 ms | 1411 KiB | 33 Q