3v4l.org

run code in 300+ PHP versions simultaneously
<?php $cookie = '101(2)_102(3)_103(5)'; preg_match_all('/(?<=^|_)([^(]+)\((\d+)\)(?=_|$)/', $cookie, $matches); $counts = array_combine($matches[1], $matches[2]); $i = 1; foreach ($counts as $id => $count) { echo "id$i: $id, count$i: $count\n"; $i++; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 29
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 29
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/vrGZf
function name:  (null)
number of ops:  31
compiled vars:  !0 = $cookie, !1 = $matches, !2 = $counts, !3 = $i, !4 = $count, !5 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '101%282%29_102%283%29_103%285%29'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%28%3F%3C%3D%5E%7C_%29%28%5B%5E%28%5D%2B%29%5C%28%28%5Cd%2B%29%5C%29%28%3F%3D_%7C%24%29%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        INIT_FCALL                                               'array_combine'
          7        FETCH_DIM_R                                      ~8      !1, 1
          8        SEND_VAL                                                 ~8
          9        FETCH_DIM_R                                      ~9      !1, 2
         10        SEND_VAL                                                 ~9
         11        DO_ICALL                                         $10     
         12        ASSIGN                                                   !2, $10
    6    13        ASSIGN                                                   !3, 1
    7    14      > FE_RESET_R                                       $13     !2, ->29
         15    > > FE_FETCH_R                                       ~14     $13, !4, ->29
         16    >   ASSIGN                                                   !5, ~14
    8    17        ROPE_INIT                                     9  ~17     'id'
         18        ROPE_ADD                                      1  ~17     ~17, !3
         19        ROPE_ADD                                      2  ~17     ~17, '%3A+'
         20        ROPE_ADD                                      3  ~17     ~17, !5
         21        ROPE_ADD                                      4  ~17     ~17, '%2C+count'
         22        ROPE_ADD                                      5  ~17     ~17, !3
         23        ROPE_ADD                                      6  ~17     ~17, '%3A+'
         24        ROPE_ADD                                      7  ~17     ~17, !4
         25        ROPE_END                                      8  ~16     ~17, '%0A'
         26        ECHO                                                     ~16
    9    27        PRE_INC                                                  !3
    7    28      > JMP                                                      ->15
         29    >   FE_FREE                                                  $13
   10    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.08 ms | 1012 KiB | 15 Q