3v4l.org

run code in 300+ PHP versions simultaneously
<?php $methods = array( 'POST', 'GET', 'POST', 'OPTIONS', 'TRACE', 'HEAD', 'OPTIONS', 'OPTIONS', 'OPTIONS', 'PATCH', 'DELETE', ); $matched_methods = array(); foreach ($methods as $method) { if (strcasecmp($method, 'POST') === 0 || strcasecmp($method, 'GET') === 0 || strcasecmp($method, 'OPTIONS') === 0) { $matched_methods[] = $method; } } var_dump($matched_methods);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 27
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 27
Branch analysis from position: 4
2 jumps found. (Code = 47) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 47) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 26
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 26
Branch analysis from position: 23
Branch analysis from position: 16
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
filename:       /in/9htJE
function name:  (null)
number of ops:  32
compiled vars:  !0 = $methods, !1 = $matched_methods, !2 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   17     1        ASSIGN                                                   !1, <array>
   19     2      > FE_RESET_R                                       $5      !0, ->27
          3    > > FE_FETCH_R                                               $5, !2, ->27
   20     4    >   INIT_FCALL                                               'strcasecmp'
          5        SEND_VAR                                                 !2
          6        SEND_VAL                                                 'POST'
          7        DO_ICALL                                         $6      
          8        IS_IDENTICAL                                     ~7      $6, 0
          9      > JMPNZ_EX                                         ~7      ~7, ->16
   21    10    >   INIT_FCALL                                               'strcasecmp'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 'GET'
         13        DO_ICALL                                         $8      
         14        IS_IDENTICAL                                     ~9      $8, 0
         15        BOOL                                             ~7      ~9
         16    > > JMPNZ_EX                                         ~7      ~7, ->23
   22    17    >   INIT_FCALL                                               'strcasecmp'
         18        SEND_VAR                                                 !2
         19        SEND_VAL                                                 'OPTIONS'
         20        DO_ICALL                                         $10     
         21        IS_IDENTICAL                                     ~11     $10, 0
         22        BOOL                                             ~7      ~11
         23    > > JMPZ                                                     ~7, ->26
   24    24    >   ASSIGN_DIM                                               !1
         25        OP_DATA                                                  !2
   19    26    > > JMP                                                      ->3
         27    >   FE_FREE                                                  $5
   28    28        INIT_FCALL                                               'var_dump'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.5 ms | 1396 KiB | 17 Q