3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pape_uri = 'http://www.example.com/some_path/to/page?param=1'; $path_parts = pathinfo($page_uri); if (!isset($path_parts['extension']) && strlen($page_uri) > 1) { $end = substr($page_uri, -1, 1); $page_uri_slash_fixed = (($end == '/') ? substr($page_uri, 0, -1) : $page_uri . '/'); } echo $page_uri; echo $page_uri_slash_fixed;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 30
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 27
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
Branch analysis from position: 11
filename:       /in/aBKf2
function name:  (null)
number of ops:  33
compiled vars:  !0 = $pape_uri, !1 = $path_parts, !2 = $page_uri, !3 = $end, !4 = $page_uri_slash_fixed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'http%3A%2F%2Fwww.example.com%2Fsome_path%2Fto%2Fpage%3Fparam%3D1'
    5     1        INIT_FCALL                                               'pathinfo'
          2        SEND_VAR                                                 !2
          3        DO_ICALL                                         $6      
          4        ASSIGN                                                   !1, $6
    7     5        ISSET_ISEMPTY_DIM_OBJ                         0  ~8      !1, 'extension'
          6        BOOL_NOT                                         ~9      ~8
          7      > JMPZ_EX                                          ~9      ~9, ->11
          8    >   STRLEN                                           ~10     !2
          9        IS_SMALLER                                       ~11     1, ~10
         10        BOOL                                             ~9      ~11
         11    > > JMPZ                                                     ~9, ->30
    8    12    >   INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 -1
         15        SEND_VAL                                                 1
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !3, $12
    9    18        IS_EQUAL                                                 !3, '%2F'
         19      > JMPZ                                                     ~14, ->27
         20    >   INIT_FCALL                                               'substr'
         21        SEND_VAR                                                 !2
         22        SEND_VAL                                                 0
         23        SEND_VAL                                                 -1
         24        DO_ICALL                                         $15     
         25        QM_ASSIGN                                        ~16     $15
         26      > JMP                                                      ->29
         27    >   CONCAT                                           ~17     !2, '%2F'
         28        QM_ASSIGN                                        ~16     ~17
         29    >   ASSIGN                                                   !4, ~16
   13    30    >   ECHO                                                     !2
   14    31        ECHO                                                     !4
         32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.23 ms | 1396 KiB | 17 Q