3v4l.org

run code in 300+ PHP versions simultaneously
<?php $agenttotest = "Googlebot/2.1 (http://www.googlebot.com/bot.html)"; $agents_to_ignore = array("googlebot", "AdsBot", "pingdom", "bot"); foreach ($agents_to_ignore as $agent) if (isset($agenttotest) && strpos(strtolower($agenttotest), strtolower($agent) !== false)) echo "block"; var_dump ( strpos(strtolower($agenttotest), strtolower("bot")) );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 6, Position 2 = 18
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 20
Branch analysis from position: 18
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/VRu59
function name:  (null)
number of ops:  36
compiled vars:  !0 = $agenttotest, !1 = $agents_to_ignore, !2 = $agent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'Googlebot%2F2.1+%28http%3A%2F%2Fwww.googlebot.com%2Fbot.html%29'
    3     1        ASSIGN                                                   !1, <array>
    4     2      > FE_RESET_R                                       $5      !1, ->21
          3    > > FE_FETCH_R                                               $5, !2, ->21
    5     4    >   ISSET_ISEMPTY_CV                                 ~6      !0
          5      > JMPZ_EX                                          ~6      ~6, ->18
          6    >   INIT_FCALL                                               'strpos'
          7        INIT_FCALL                                               'strtolower'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        INIT_FCALL                                               'strtolower'
         12        SEND_VAR                                                 !2
         13        DO_ICALL                                         $8      
         14        TYPE_CHECK                                  1018  ~9      $8
         15        SEND_VAL                                                 ~9
         16        DO_ICALL                                         $10     
         17        BOOL                                             ~6      $10
         18    > > JMPZ                                                     ~6, ->20
    6    19    >   ECHO                                                     'block'
    4    20    > > JMP                                                      ->3
         21    >   FE_FREE                                                  $5
    8    22        INIT_FCALL                                               'var_dump'
         23        INIT_FCALL                                               'strpos'
         24        INIT_FCALL                                               'strtolower'
         25        SEND_VAR                                                 !0
         26        DO_ICALL                                         $11     
         27        SEND_VAR                                                 $11
         28        INIT_FCALL                                               'strtolower'
         29        SEND_VAL                                                 'bot'
         30        DO_ICALL                                         $12     
         31        SEND_VAR                                                 $12
         32        DO_ICALL                                         $13     
         33        SEND_VAR                                                 $13
         34        DO_ICALL                                                 
         35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.16 ms | 1388 KiB | 19 Q