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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.96 ms | 1400 KiB | 19 Q