3v4l.org

run code in 300+ PHP versions simultaneously
<?php $value = "[Code][WST-2587] hello world WST-2587 IC-111"; print($value); print("\n"); $trimPattern = '/^[”’"\'(<]*@?(.+?)[.”’"\'\,!?:;)>]*$/'; print($trimPattern); print("\n"); $projects = array('IC', 'WST'); $calloutPattern = "/^(?:" . implode('|', $projects) . ")-[0-9]+$/"; print($calloutPattern); print("\n"); $words = preg_split('/(\s+)/', $value); print "\nWords:\n"; foreach ($words as $word) { print($word); print("\n"); } preg_match_all('/[(<\[]((' . implode('|', $projects) . ')-[0-9]+)[\]>)]/', $value, $matches); print "\nMatches:\n"; foreach ($matches[1] as $match) { print($match); print("\n"); } //$words = array_merge($words, $matches[1]); $words = $words + $matches[1]; print "\nMerged Words:\n"; foreach ($words as $word) { print($word); print("\n"); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 27
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 42, Position 2 = 46
Branch analysis from position: 42
2 jumps found. (Code = 78) Position 1 = 43, Position 2 = 46
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 42
Branch analysis from position: 42
Branch analysis from position: 46
2 jumps found. (Code = 77) Position 1 = 52, Position 2 = 56
Branch analysis from position: 52
2 jumps found. (Code = 78) Position 1 = 53, Position 2 = 56
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 56
Branch analysis from position: 46
Branch analysis from position: 27
filename:       /in/jStCG
function name:  (null)
number of ops:  58
compiled vars:  !0 = $value, !1 = $trimPattern, !2 = $projects, !3 = $calloutPattern, !4 = $words, !5 = $word, !6 = $matches, !7 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5BCode%5D%5BWST-2587%5D+hello+world+WST-2587+IC-111'
    4     1        ECHO                                                     !0
    5     2        ECHO                                                     '%0A'
    6     3        ASSIGN                                                   !1, '%2F%5E%5B%E2%80%9D%E2%80%99%22%27%28%3C%5D%2A%40%3F%28.%2B%3F%29%5B.%E2%80%9D%E2%80%99%22%27%5C%2C%21%3F%3A%3B%29%3E%5D%2A%24%2F'
    7     4        ECHO                                                     !1
    8     5        ECHO                                                     '%0A'
    9     6        ASSIGN                                                   !2, <array>
   10     7        INIT_FCALL                                               'implode'
          8        SEND_VAL                                                 '%7C'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                         $11     
         11        CONCAT                                           ~12     '%2F%5E%28%3F%3A', $11
         12        CONCAT                                           ~13     ~12, '%29-%5B0-9%5D%2B%24%2F'
         13        ASSIGN                                                   !3, ~13
   11    14        ECHO                                                     !3
   12    15        ECHO                                                     '%0A'
   13    16        INIT_FCALL                                               'preg_split'
         17        SEND_VAL                                                 '%2F%28%5Cs%2B%29%2F'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $15     
         20        ASSIGN                                                   !4, $15
   14    21        ECHO                                                     '%0AWords%3A%0A'
   15    22      > FE_RESET_R                                       $17     !4, ->27
         23    > > FE_FETCH_R                                               $17, !5, ->27
   16    24    >   ECHO                                                     !5
   17    25        ECHO                                                     '%0A'
   15    26      > JMP                                                      ->23
         27    >   FE_FREE                                                  $17
   20    28        INIT_FCALL                                               'preg_match_all'
         29        INIT_FCALL                                               'implode'
         30        SEND_VAL                                                 '%7C'
         31        SEND_VAR                                                 !2
         32        DO_ICALL                                         $18     
         33        CONCAT                                           ~19     '%2F%5B%28%3C%5C%5B%5D%28%28', $18
         34        CONCAT                                           ~20     ~19, '%29-%5B0-9%5D%2B%29%5B%5C%5D%3E%29%5D%2F'
         35        SEND_VAL                                                 ~20
         36        SEND_VAR                                                 !0
         37        SEND_REF                                                 !6
         38        DO_ICALL                                                 
   21    39        ECHO                                                     '%0AMatches%3A%0A'
   22    40        FETCH_DIM_R                                      ~22     !6, 1
         41      > FE_RESET_R                                       $23     ~22, ->46
         42    > > FE_FETCH_R                                               $23, !7, ->46
   23    43    >   ECHO                                                     !7
   24    44        ECHO                                                     '%0A'
   22    45      > JMP                                                      ->42
         46    >   FE_FREE                                                  $23
   28    47        FETCH_DIM_R                                      ~24     !6, 1
         48        ADD                                              ~25     !4, ~24
         49        ASSIGN                                                   !4, ~25
   29    50        ECHO                                                     '%0AMerged+Words%3A%0A'
   30    51      > FE_RESET_R                                       $27     !4, ->56
         52    > > FE_FETCH_R                                               $27, !5, ->56
   31    53    >   ECHO                                                     !5
   32    54        ECHO                                                     '%0A'
   30    55      > JMP                                                      ->52
         56    >   FE_FREE                                                  $27
   33    57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.83 ms | 1400 KiB | 19 Q