3v4l.org

run code in 300+ PHP versions simultaneously
<?php $output = 'tag: 7.x-2.x-1511112-53-combined tag: 7.x-2.x-1511112-50-static-cache-per-git-dir HEAD, tag: xxxx, origin/HEAD, origin/7.x-2.x, 7.x-2.x tag: 7.x-3.0--alpha5 tag: 7.x-2.2 tag: 7.x-2.1 tag: 7.x-2.0'; $lines = explode("\n", $output); $tag = NULL; foreach ($lines as $line) { $parts = explode(', ', $line); foreach ($parts as $part) { if (preg_match('/^tag: (\d+\.x\-\d+\.\d+(?:|\-\w+\d+))$/', $part, $m)) { $tag = $m[1]; break 2; } } } var_export($tag);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 29
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 29
Branch analysis from position: 9
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 27
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 27
Branch analysis from position: 29
Branch analysis from position: 29
filename:       /in/EoTrg
function name:  (null)
number of ops:  34
compiled vars:  !0 = $output, !1 = $lines, !2 = $tag, !3 = $line, !4 = $parts, !5 = $part, !6 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'tag%3A+7.x-2.x-1511112-53-combined%0Atag%3A+7.x-2.x-1511112-50-static-cache-per-git-dir%0AHEAD%2C+tag%3A+xxxx%2C+origin%2FHEAD%2C+origin%2F7.x-2.x%2C+7.x-2.x%0Atag%3A+7.x-3.0--alpha5%0Atag%3A+7.x-2.2%0Atag%3A+7.x-2.1%0Atag%3A+7.x-2.0'
   11     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%0A'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $8      
          5        ASSIGN                                                   !1, $8
   13     6        ASSIGN                                                   !2, null
   14     7      > FE_RESET_R                                       $11     !1, ->29
          8    > > FE_FETCH_R                                               $11, !3, ->29
   15     9    >   INIT_FCALL                                               'explode'
         10        SEND_VAL                                                 '%2C+'
         11        SEND_VAR                                                 !3
         12        DO_ICALL                                         $12     
         13        ASSIGN                                                   !4, $12
   16    14      > FE_RESET_R                                       $14     !4, ->27
         15    > > FE_FETCH_R                                               $14, !5, ->27
   17    16    >   INIT_FCALL                                               'preg_match'
         17        SEND_VAL                                                 '%2F%5Etag%3A+%28%5Cd%2B%5C.x%5C-%5Cd%2B%5C.%5Cd%2B%28%3F%3A%7C%5C-%5Cw%2B%5Cd%2B%29%29%24%2F'
         18        SEND_VAR                                                 !5
         19        SEND_REF                                                 !6
         20        DO_ICALL                                         $15     
         21      > JMPZ                                                     $15, ->26
   18    22    >   FETCH_DIM_R                                      ~16     !6, 1
         23        ASSIGN                                                   !2, ~16
   19    24        FE_FREE                                                  $14
         25      > JMP                                                      ->29
   16    26    > > JMP                                                      ->15
         27    >   FE_FREE                                                  $14
   14    28      > JMP                                                      ->8
         29    >   FE_FREE                                                  $11
   24    30        INIT_FCALL                                               'var_export'
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.91 ms | 1007 KiB | 16 Q