3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input_line = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"; $arr = preg_split("/( \()|(\) )/", $input_line); $arr2 =explode(" ", end($arr)); Unset($arr[count($arr)-1]); $arr = Array_merge($arr,$arr2); Var_dump($arr); $search = "Chr"; Foreach($arr as $val){ If($search == Substr($val,0,3)) echo $val; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 37
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 37
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 36
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 36
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
filename:       /in/qF65g
function name:  (null)
number of ops:  39
compiled vars:  !0 = $input_line, !1 = $arr, !2 = $arr2, !3 = $search, !4 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'Mozilla%2F5.0+%28Windows+NT+10.0%3B+Win64%3B+x64%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F60.0.3112.90+Safari%2F537.36'
    5     1        INIT_FCALL                                               'preg_split'
          2        SEND_VAL                                                 '%2F%28+%5C%28%29%7C%28%5C%29+%29%2F'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $6      
          5        ASSIGN                                                   !1, $6
    7     6        INIT_FCALL                                               'explode'
          7        SEND_VAL                                                 '+'
          8        INIT_FCALL                                               'end'
          9        SEND_REF                                                 !1
         10        DO_ICALL                                         $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                         $9      
         13        ASSIGN                                                   !2, $9
    8    14        COUNT                                            ~11     !1
         15        SUB                                              ~12     ~11, 1
         16        UNSET_DIM                                                !1, ~12
    9    17        INIT_FCALL                                               'array_merge'
         18        SEND_VAR                                                 !1
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $13     
         21        ASSIGN                                                   !1, $13
   10    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
   12    25        ASSIGN                                                   !3, 'Chr'
   14    26      > FE_RESET_R                                       $17     !1, ->37
         27    > > FE_FETCH_R                                               $17, !4, ->37
   15    28    >   INIT_FCALL                                               'substr'
         29        SEND_VAR                                                 !4
         30        SEND_VAL                                                 0
         31        SEND_VAL                                                 3
         32        DO_ICALL                                         $18     
         33        IS_EQUAL                                                 !3, $18
         34      > JMPZ                                                     ~19, ->36
         35    >   ECHO                                                     !4
   14    36    > > JMP                                                      ->27
         37    >   FE_FREE                                                  $17
   16    38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.24 ms | 1021 KiB | 19 Q