3v4l.org

run code in 300+ PHP versions simultaneously
<?php //because Safari wont play ball $browser = $_SERVER['HTTP_USER_AGENT']; $allowedBrowsers = array("Chrome", "Firefox"); $badBrowsers = array("Safari"); foreach ($allowedBrowsers as $userBrowser) { if (strpos($browser, $userBrowser) !== false) { print "<input type='search' name='search' placeholder='type here'>"; break; } else { print "<input type='text' name='search' placeholder='type here'>"; } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 18
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 18
Branch analysis from position: 18
filename:       /in/XdXq7
function name:  (null)
number of ops:  20
compiled vars:  !0 = $browser, !1 = $allowedBrowsers, !2 = $badBrowsers, !3 = $userBrowser
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FETCH_R                      global              ~4      '_SERVER'
          1        FETCH_DIM_R                                      ~5      ~4, 'HTTP_USER_AGENT'
          2        ASSIGN                                                   !0, ~5
    5     3        ASSIGN                                                   !1, <array>
    6     4        ASSIGN                                                   !2, <array>
    8     5      > FE_RESET_R                                       $9      !1, ->18
          6    > > FE_FETCH_R                                               $9, !3, ->18
    9     7    >   INIT_FCALL                                               'strpos'
          8        SEND_VAR                                                 !0
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $10     
         11        TYPE_CHECK                                  1018          $10
         12      > JMPZ                                                     ~11, ->16
   10    13    >   ECHO                                                     '%3Cinput+type%3D%27search%27+name%3D%27search%27+placeholder%3D%27type+here%27%3E'
   11    14      > JMP                                                      ->18
         15*       JMP                                                      ->17
   14    16    >   ECHO                                                     '%3Cinput+type%3D%27text%27+name%3D%27search%27+placeholder%3D%27type+here%27%3E'
    8    17      > JMP                                                      ->6
         18    >   FE_FREE                                                  $9
   18    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.42 ms | 1395 KiB | 15 Q