3v4l.org

run code in 300+ PHP versions simultaneously
<?php function ff_iswebcrawler(){ $_SERVER = array('HTTP_USER_AGENT' => 'asdlfkjsd'); $ua = strtolower($_SERVER['HTTP_USER_AGENT']); return ( stripos($ua,'googlebot-mobile') !== false || (stripos($ua,'iphone') !== false && stripos($ua,'googlebot') !== false) ); } if(ff_iswebcrawler()) { echo 'yep'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
filename:       /in/B60lJ
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'ff_iswebcrawler'
          1        DO_FCALL                                      0  $0      
          2      > JMPZ                                                     $0, ->4
   16     3    >   ECHO                                                     'yep'
   17     4    > > RETURN                                                   1

Function ff_iswebcrawler:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 14, Position 2 = 27
Branch analysis from position: 14
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
Branch analysis from position: 27
filename:       /in/B60lJ
function name:  ff_iswebcrawler
number of ops:  29
compiled vars:  !0 = $ua
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   FETCH_W                      global              $1      '_SERVER'
          1        ASSIGN                                                   $1, <array>
    7     2        INIT_FCALL                                               'strtolower'
          3        FETCH_R                      global              ~3      '_SERVER'
          4        FETCH_DIM_R                                      ~4      ~3, 'HTTP_USER_AGENT'
          5        SEND_VAL                                                 ~4
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !0, $5
    9     8        INIT_FCALL                                               'stripos'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 'googlebot-mobile'
         11        DO_ICALL                                         $7      
         12        TYPE_CHECK                                  1018  ~8      $7
         13      > JMPNZ_EX                                         ~8      ~8, ->27
   10    14    >   INIT_FCALL                                               'stripos'
         15        SEND_VAR                                                 !0
         16        SEND_VAL                                                 'iphone'
         17        DO_ICALL                                         $9      
         18        TYPE_CHECK                                  1018  ~10     $9
         19      > JMPZ_EX                                          ~10     ~10, ->26
         20    >   INIT_FCALL                                               'stripos'
         21        SEND_VAR                                                 !0
         22        SEND_VAL                                                 'googlebot'
         23        DO_ICALL                                         $11     
         24        TYPE_CHECK                                  1018  ~12     $11
         25        BOOL                                             ~10     ~12
         26    >   BOOL                                             ~8      ~10
         27    > > RETURN                                                   ~8
   12    28*     > RETURN                                                   null

End of function ff_iswebcrawler

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.1 ms | 1390 KiB | 18 Q