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){ echo strtolower($agenttotest) . " " . strtolower($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 = 30
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 30
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 27
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 29
Branch analysis from position: 27
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/PmYRv
function name:  (null)
number of ops:  45
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, ->30
          3    > > FE_FETCH_R                                               $5, !2, ->30
    5     4    >   INIT_FCALL                                               'strtolower'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $6      
          7        CONCAT                                           ~7      $6, '+'
          8        INIT_FCALL                                               'strtolower'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $8      
         11        CONCAT                                           ~9      ~7, $8
         12        ECHO                                                     ~9
    6    13        ISSET_ISEMPTY_CV                                 ~10     !0
         14      > JMPZ_EX                                          ~10     ~10, ->27
         15    >   INIT_FCALL                                               'strpos'
         16        INIT_FCALL                                               'strtolower'
         17        SEND_VAR                                                 !0
         18        DO_ICALL                                         $11     
         19        SEND_VAR                                                 $11
         20        INIT_FCALL                                               'strtolower'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                         $12     
         23        TYPE_CHECK                                  1018  ~13     $12
         24        SEND_VAL                                                 ~13
         25        DO_ICALL                                         $14     
         26        BOOL                                             ~10     $14
         27    > > JMPZ                                                     ~10, ->29
    7    28    >   ECHO                                                     'block'
    4    29    > > JMP                                                      ->3
         30    >   FE_FREE                                                  $5
   10    31        INIT_FCALL                                               'var_dump'
         32        INIT_FCALL                                               'strpos'
         33        INIT_FCALL                                               'strtolower'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                         $15     
         36        SEND_VAR                                                 $15
         37        INIT_FCALL                                               'strtolower'
         38        SEND_VAL                                                 'bot'
         39        DO_ICALL                                         $16     
         40        SEND_VAR                                                 $16
         41        DO_ICALL                                         $17     
         42        SEND_VAR                                                 $17
         43        DO_ICALL                                                 
         44      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.62 ms | 1392 KiB | 19 Q