3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = 'test/?/render/shell'; function f($char) { switch ($char) { case '/': return $char; case '?': return $char; default: return false; } } var_dump(f($s[0]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QAU4c
function name:  (null)
number of ops:  9
compiled vars:  !0 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'test%2F%3F%2Frender%2Fshell'
   15     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'f'
          3        FETCH_DIM_R                                      ~2      !0, 0
          4        SEND_VAL                                                 ~2
          5        DO_FCALL                                      0  $3      
          6        SEND_VAR                                                 $3
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
4 jumps found. (Code = 188) Position 1 = 7, Position 2 = 8, Position 3 = 9, Position 4 = 2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 8
Branch analysis from position: 7
filename:       /in/QAU4c
function name:  f
number of ops:  11
compiled vars:  !0 = $char
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1      > SWITCH_STRING                                            !0, [ '%2F':->7, '%3F':->8, ], ->9
    6     2    >   IS_EQUAL                                                 !0, '%2F'
          3      > JMPNZ                                                    ~1, ->7
    8     4    >   IS_EQUAL                                                 !0, '%3F'
          5      > JMPNZ                                                    ~1, ->8
          6    > > JMP                                                      ->9
    7     7    > > RETURN                                                   !0
    9     8    > > RETURN                                                   !0
   11     9    > > RETURN                                                   <false>
   13    10*     > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.95 ms | 1398 KiB | 16 Q