3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ua = 'Mozilla/5.0 (Linux; Android 4.0; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19'; $pattern = "/Android (\d).(\d)(?:.(\d))?/"; preg_match($pattern, $ua, $matches); $androidversion = array(0,0,0); if (sizeof($matches) == 0 ) { error_log("No Android version match");}if (sizeof($matches) == 1) { error_log("No major version");} if (sizeof($matches) >= 2) { $androidversion[0] = $matches[1];}if (sizeof($matches) >=3) { $androidversion[1] = $matches[2];}if (sizeof($matches) >= 4) { $androidversion[2] = $matches[3];}print_r($androidversion);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 20
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 38
Branch analysis from position: 35
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
Branch analysis from position: 32
Branch analysis from position: 26
Branch analysis from position: 20
Branch analysis from position: 14
filename:       /in/lCZiR
function name:  (null)
number of ops:  42
compiled vars:  !0 = $ua, !1 = $pattern, !2 = $matches, !3 = $androidversion
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ASSIGN                                                   !0, 'Mozilla%2F5.0+%28Linux%3B+Android+4.0%3B+Galaxy+Nexus+Build%2FIMM76B%29+AppleWebKit%2F535.19+%28KHTML%2C+like+Gecko%29+Chrome%2F18.0.1025.133+Mobile+Safari%2F535.19'
          1        ASSIGN                                                   !1, '%2FAndroid+%28%5Cd%29.%28%5Cd%29%28%3F%3A.%28%5Cd%29%29%3F%2F'
          2        INIT_FCALL                                               'preg_match'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
          7        ASSIGN                                                   !3, <array>
          8        COUNT                                            ~8      !2
          9        IS_EQUAL                                                 ~8, 0
         10      > JMPZ                                                     ~9, ->14
         11    >   INIT_FCALL                                               'error_log'
         12        SEND_VAL                                                 'No+Android+version+match'
         13        DO_ICALL                                                 
         14    >   COUNT                                            ~11     !2
         15        IS_EQUAL                                                 ~11, 1
         16      > JMPZ                                                     ~12, ->20
         17    >   INIT_FCALL                                               'error_log'
         18        SEND_VAL                                                 'No+major+version'
         19        DO_ICALL                                                 
         20    >   COUNT                                            ~14     !2
         21        IS_SMALLER_OR_EQUAL                                      2, ~14
         22      > JMPZ                                                     ~15, ->26
         23    >   FETCH_DIM_R                                      ~17     !2, 1
         24        ASSIGN_DIM                                               !3, 0
         25        OP_DATA                                                  ~17
         26    >   COUNT                                            ~18     !2
         27        IS_SMALLER_OR_EQUAL                                      3, ~18
         28      > JMPZ                                                     ~19, ->32
         29    >   FETCH_DIM_R                                      ~21     !2, 2
         30        ASSIGN_DIM                                               !3, 1
         31        OP_DATA                                                  ~21
         32    >   COUNT                                            ~22     !2
         33        IS_SMALLER_OR_EQUAL                                      4, ~22
         34      > JMPZ                                                     ~23, ->38
         35    >   FETCH_DIM_R                                      ~25     !2, 3
         36        ASSIGN_DIM                                               !3, 2
         37        OP_DATA                                                  ~25
         38    >   INIT_FCALL                                               'print_r'
         39        SEND_VAR                                                 !3
         40        DO_ICALL                                                 
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.28 ms | 1392 KiB | 19 Q