3v4l.org

run code in 300+ PHP versions simultaneously
<?php $controller = 'example.com/home/index?lang=nl'; $n = strpos($controller, "?lang="); if ($n > 0){ $lang = substr($controller, $n + 6); $controller = substr($controller,0, $n); } var_dump($lang, $controller);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 20
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/PeHUA
function name:  (null)
number of ops:  25
compiled vars:  !0 = $controller, !1 = $n, !2 = $lang
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'example.com%2Fhome%2Findex%3Flang%3Dnl'
    5     1        INIT_FCALL                                               'strpos'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 '%3Flang%3D'
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    6     6        IS_SMALLER                                               0, !1
          7      > JMPZ                                                     ~6, ->20
    7     8    >   INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        ADD                                              ~7      !1, 6
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !2, $8
    8    14        INIT_FCALL                                               'substr'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 0
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $10     
         19        ASSIGN                                                   !0, $10
   11    20    >   INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.11 ms | 1395 KiB | 19 Q