3v4l.org

run code in 300+ PHP versions simultaneously
<?php //because Safari wont play ball $browser = $_SERVER['HTTP_USER_AGENT'] . "\n\n"; $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 = 7, Position 2 = 19
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 19
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 17
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 19
Branch analysis from position: 19
filename:       /in/iSTpH
function name:  (null)
number of ops:  21
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        CONCAT                                           ~6      ~5, '%0A%0A'
          3        ASSIGN                                                   !0, ~6
    5     4        ASSIGN                                                   !1, <array>
    6     5        ASSIGN                                                   !2, <array>
    8     6      > FE_RESET_R                                       $10     !1, ->19
          7    > > FE_FETCH_R                                               $10, !3, ->19
    9     8    >   INIT_FCALL                                               'strpos'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                         $11     
         12        TYPE_CHECK                                  1018          $11
         13      > JMPZ                                                     ~12, ->17
   10    14    >   ECHO                                                     '%3Cinput+type%3D%27search%27+name%3D%27search%27+placeholder%3D%27type+here%27%3E'
   11    15      > JMP                                                      ->19
         16*       JMP                                                      ->18
   14    17    >   ECHO                                                     '%3Cinput+type%3D%27text%27+name%3D%27search%27+placeholder%3D%27type+here%27%3E'
    8    18      > JMP                                                      ->7
         19    >   FE_FREE                                                  $10
   18    20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.15 ms | 1395 KiB | 15 Q