3v4l.org

run code in 300+ PHP versions simultaneously
<?php $_SERVER['REQUEST_URI'] = '/controller/action?id=123'; $uri = $_SERVER['REQUEST_URI']; $uri = parse_url($uri); $route = explode('/', ltrim($uri['path'], '/')); print_r($route); parse_str($uri['query'], $query); print_r($query);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UMFQF
function name:  (null)
number of ops:  32
compiled vars:  !0 = $uri, !1 = $route, !2 = $query
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_W                      global              $3      '_SERVER'
          1        ASSIGN_DIM                                               $3, 'REQUEST_URI'
          2        OP_DATA                                                  '%2Fcontroller%2Faction%3Fid%3D123'
    5     3        FETCH_R                      global              ~5      '_SERVER'
          4        FETCH_DIM_R                                      ~6      ~5, 'REQUEST_URI'
          5        ASSIGN                                                   !0, ~6
    7     6        INIT_FCALL                                               'parse_url'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !0, $8
    9    10        INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 '%2F'
         12        INIT_FCALL                                               'ltrim'
         13        FETCH_DIM_R                                      ~10     !0, 'path'
         14        SEND_VAL                                                 ~10
         15        SEND_VAL                                                 '%2F'
         16        DO_ICALL                                         $11     
         17        SEND_VAR                                                 $11
         18        DO_ICALL                                         $12     
         19        ASSIGN                                                   !1, $12
   10    20        INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !1
         22        DO_ICALL                                                 
   12    23        INIT_FCALL                                               'parse_str'
         24        FETCH_DIM_R                                      ~15     !0, 'query'
         25        SEND_VAL                                                 ~15
         26        SEND_REF                                                 !2
         27        DO_ICALL                                                 
   13    28        INIT_FCALL                                               'print_r'
         29        SEND_VAR                                                 !2
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.46 ms | 1016 KiB | 18 Q