3v4l.org

run code in 300+ PHP versions simultaneously
<?php $androidApp = 'ZooskAndroid'; $iphoneApp = 'ZooskiPhone'; $ipadApp = 'ZooskiPad'; $agent = 'ZooskAndroid/133 (Linux; U; Android 4.4.2; en-US; HTC One; Build/KOT49H.H1)'; $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/2Fbnl
function name:  (null)
number of ops:  58
compiled vars:  !0 = $androidApp, !1 = $iphoneApp, !2 = $ipadApp, !3 = $agent, !4 = $regExp, !5 = $ua, !6 = $matches, !7 = $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%2F133+%28Linux%3B+U%3B+Android+4.4.2%3B+en-US%3B+HTC+One%3B+Build%2FKOT49H.H1%29'
    8     4        CONCAT                                           ~12     '%2F%5E%28%3F%3A%28%3F%3A', !0
          5        CONCAT                                           ~13     ~12, '%29%7C%28%3F%3A'
          6        CONCAT                                           ~14     ~13, !1
          7        CONCAT                                           ~15     ~14, '%29%7C%28%3F%3A'
          8        CONCAT                                           ~16     ~15, !2
          9        CONCAT                                           ~17     ~16, '%29%29%5C%2F%28%5B0-9.%5D%7B1%2C6%7D%29%2C%2F'
         10        ASSIGN                                                   !4, ~17
   10    11        INIT_FCALL                                               'preg_match_all'
         12        SEND_VAR                                                 !4
         13        SEND_VAR                                                 !5
         14        SEND_REF                                                 !6
         15        DO_ICALL                                                 
   12    16        TYPE_CHECK                                  128  ~20     !6
         17      > JMPZ_EX                                          ~20     ~20, ->21
         18    >   COUNT                                            ~21     !6
         19        IS_IDENTICAL                                     ~22     ~21, 2
         20        BOOL                                             ~20     ~22
         21    > > JMPZ                                                     ~20, ->24
   13    22    >   FETCH_DIM_R                                      ~23     !6, 1
         23        ASSIGN                                                   !7, ~23
   16    24    >   ISSET_ISEMPTY_CV                                         !7
         25      > JMPZ                                                     ~25, ->36
   18    26    >   CONCAT                                           ~26     '%2F%5E%28%3F%3A%28%3F%3A', !0
         27        CONCAT                                           ~27     ~26, '%29%29%5C%2F%28%5B0-9.%5D%7B1%2C6%7D%29+%5C%28%2F'
         28        ASSIGN                                                   !4, ~27
   19    29        INIT_FCALL                                               'preg_match_all'
         30        SEND_VAR                                                 !4
         31        SEND_VAR                                                 !5
         32        SEND_REF                                                 !6
         33        DO_ICALL                                                 
   20    34        FETCH_DIM_R                                      ~30     !6, 1
         35        ASSIGN                                                   !7, ~30
   23    36    >   TYPE_CHECK                                  128  ~32     !7
         37      > JMPZ_EX                                          ~32     ~32, ->41
         38    >   COUNT                                            ~33     !7
         39        IS_IDENTICAL                                     ~34     ~33, 1
         40        BOOL                                             ~32     ~34
         41    > > JMPZ                                                     ~32, ->55
   24    42    >   INIT_FCALL                                               'current'
         43        SEND_VAR                                                 !7
         44        DO_ICALL                                         $35     
         45        TYPE_CHECK                                  128          $35
         46      > JMPZ                                                     ~36, ->49
         47    >   QM_ASSIGN                                        ~37     null
         48      > JMP                                                      ->53
         49    >   INIT_FCALL                                               'current'
         50        SEND_VAR                                                 !7
         51        DO_ICALL                                         $38     
         52        QM_ASSIGN                                        ~37     $38
         53    >   ASSIGN                                                   !7, ~37
         54      > JMP                                                      ->56
   26    55    >   ASSIGN                                                   !7, null
   29    56    >   ECHO                                                     !7
         57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.46 ms | 1400 KiB | 17 Q