3v4l.org

run code in 300+ PHP versions simultaneously
<?php function is_wptouch_user_agent() { // This needs to match your WP Touch list!! $useragents = array( "iphone", // Apple iPhone "ipod", // Apple iPod touch "aspen", // iPhone simulator "dream", // Pre 1.5 Android "android", // 1.5+ Android "cupcake", // 1.5+ Android "blackberry9500", // Storm "blackberry9530", // Storm "opera mini", // Experimental "webos", // Experimental "incognito", // Other iPhone browser "webmate" // Other iPhone browser ); $browser_agent = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16"; $is_wptouch_ua = false; foreach ( $useragents as $useragent ) { if ( preg_match( "#$useragent#i", $browser_agent ) ) { $is_wptouch_ua = true; break; } } return($is_wptouch_ua); } global $batcache; $batcache->unique['wptouch'] = is_wptouch_user_agent(); echo $batcache->unique['wptouch'];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/32KHd
function name:  (null)
number of ops:  10
compiled vars:  !0 = $batcache
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   BIND_GLOBAL                                              !0, 'batcache'
   32     1        INIT_FCALL                                               'is_wptouch_user_agent'
          2        DO_FCALL                                      0  $3      
          3        FETCH_OBJ_W                                      $1      !0, 'unique'
          4        ASSIGN_DIM                                               $1, 'wptouch'
          5        OP_DATA                                                  $3
   34     6        FETCH_OBJ_R                                      ~4      !0, 'unique'
          7        FETCH_DIM_R                                      ~5      ~4, 'wptouch'
          8        ECHO                                                     ~5
          9      > RETURN                                                   1

Function is_wptouch_user_agent:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 16
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 16
Branch analysis from position: 16
filename:       /in/32KHd
function name:  is_wptouch_user_agent
number of ops:  19
compiled vars:  !0 = $useragents, !1 = $browser_agent, !2 = $is_wptouch_ua, !3 = $useragent
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
   19     1        ASSIGN                                                   !1, 'Mozilla%2F5.0+%28iPhone%3B+U%3B+CPU+iPhone+OS+3_0+like+Mac+OS+X%3B+en-us%29+AppleWebKit%2F528.18+%28KHTML%2C+like+Gecko%29+Version%2F4.0+Mobile%2F7A341+Safari%2F528.16'
   20     2        ASSIGN                                                   !2, <false>
   21     3      > FE_RESET_R                                       $7      !0, ->16
          4    > > FE_FETCH_R                                               $7, !3, ->16
   22     5    >   INIT_FCALL                                               'preg_match'
          6        ROPE_INIT                                     3  ~9      '%23'
          7        ROPE_ADD                                      1  ~9      ~9, !3
          8        ROPE_END                                      2  ~8      ~9, '%23i'
          9        SEND_VAL                                                 ~8
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $11     
         12      > JMPZ                                                     $11, ->15
   23    13    >   ASSIGN                                                   !2, <true>
   24    14      > JMP                                                      ->16
   21    15    > > JMP                                                      ->4
         16    >   FE_FREE                                                  $7
   28    17      > RETURN                                                   !2
   29    18*     > RETURN                                                   null

End of function is_wptouch_user_agent

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.13 ms | 1399 KiB | 16 Q