3v4l.org

run code in 300+ PHP versions simultaneously
<?php $androidApp = 'ZooskAndroid'; $iphoneApp = 'ZooskiPhone'; $ipadApp = 'ZooskiPad'; $ua = 'ZooskAndroid/167 (Linux; U; Android 4.2.2; en-US; KFSOWI; Build/JDQ39)'; $regExp = '/^(?:(?:' . $androidApp . ')|(?:' . $iphoneApp . ')|(?:' . $ipadApp . '))\/([0-9.]{1,6}),/'; preg_match_all($regExp, $ua, $matches); if (is_array($matches) && count($matches) === 2) { $version = $matches[1]; } if (empty($version)) { // ZooskAndroid/133 (Linux; U; Android 4.4.2; en-US; HTC One; Build/KOT49H.H1) $regExp = '/^(?:(?:' . $androidApp . '))\/([0-9.]{1,6}) \(/'; preg_match_all($regExp, $ua, $matches); $version = $matches[1]; } if (is_array($version) && count($version) === 1) { $version = is_array(current($version)) ? null : current($version); } else { $version = null; } echo $version;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 21
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 36
Branch analysis from position: 26
2 jumps found. (Code = 46) Position 1 = 38, Position 2 = 41
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 55
Branch analysis from position: 42
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 36
Branch analysis from position: 24
Branch analysis from position: 21
filename:       /in/ftADN
function name:  (null)
number of ops:  58
compiled vars:  !0 = $androidApp, !1 = $iphoneApp, !2 = $ipadApp, !3 = $ua, !4 = $regExp, !5 = $matches, !6 = $version
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'ZooskAndroid'
    4     1        ASSIGN                                                   !1, 'ZooskiPhone'
    5     2        ASSIGN                                                   !2, 'ZooskiPad'
    7     3        ASSIGN                                                   !3, 'ZooskAndroid%2F167+%28Linux%3B+U%3B+Android+4.2.2%3B+en-US%3B+KFSOWI%3B+Build%2FJDQ39%29'
    8     4        CONCAT                                           ~11     '%2F%5E%28%3F%3A%28%3F%3A', !0
          5        CONCAT                                           ~12     ~11, '%29%7C%28%3F%3A'
          6        CONCAT                                           ~13     ~12, !1
          7        CONCAT                                           ~14     ~13, '%29%7C%28%3F%3A'
          8        CONCAT                                           ~15     ~14, !2
          9        CONCAT                                           ~16     ~15, '%29%29%5C%2F%28%5B0-9.%5D%7B1%2C6%7D%29%2C%2F'
         10        ASSIGN                                                   !4, ~16
   10    11        INIT_FCALL                                               'preg_match_all'
         12        SEND_VAR                                                 !4
         13        SEND_VAR                                                 !3
         14        SEND_REF                                                 !5
         15        DO_ICALL                                                 
   12    16        TYPE_CHECK                                  128  ~19     !5
         17      > JMPZ_EX                                          ~19     ~19, ->21
         18    >   COUNT                                            ~20     !5
         19        IS_IDENTICAL                                     ~21     ~20, 2
         20        BOOL                                             ~19     ~21
         21    > > JMPZ                                                     ~19, ->24
   13    22    >   FETCH_DIM_R                                      ~22     !5, 1
         23        ASSIGN                                                   !6, ~22
   16    24    >   ISSET_ISEMPTY_CV                                         !6
         25      > JMPZ                                                     ~24, ->36
   18    26    >   CONCAT                                           ~25     '%2F%5E%28%3F%3A%28%3F%3A', !0
         27        CONCAT                                           ~26     ~25, '%29%29%5C%2F%28%5B0-9.%5D%7B1%2C6%7D%29+%5C%28%2F'
         28        ASSIGN                                                   !4, ~26
   19    29        INIT_FCALL                                               'preg_match_all'
         30        SEND_VAR                                                 !4
         31        SEND_VAR                                                 !3
         32        SEND_REF                                                 !5
         33        DO_ICALL                                                 
   20    34        FETCH_DIM_R                                      ~29     !5, 1
         35        ASSIGN                                                   !6, ~29
   23    36    >   TYPE_CHECK                                  128  ~31     !6
         37      > JMPZ_EX                                          ~31     ~31, ->41
         38    >   COUNT                                            ~32     !6
         39        IS_IDENTICAL                                     ~33     ~32, 1
         40        BOOL                                             ~31     ~33
         41    > > JMPZ                                                     ~31, ->55
   24    42    >   INIT_FCALL                                               'current'
         43        SEND_VAR                                                 !6
         44        DO_ICALL                                         $34     
         45        TYPE_CHECK                                  128          $34
         46      > JMPZ                                                     ~35, ->49
         47    >   QM_ASSIGN                                        ~36     null
         48      > JMP                                                      ->53
         49    >   INIT_FCALL                                               'current'
         50        SEND_VAR                                                 !6
         51        DO_ICALL                                         $37     
         52        QM_ASSIGN                                        ~36     $37
         53    >   ASSIGN                                                   !6, ~36
         54      > JMP                                                      ->56
   26    55    >   ASSIGN                                                   !6, null
   29    56    >   ECHO                                                     !6
         57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.17 ms | 1400 KiB | 17 Q