3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/\|{\K\d+(?=})/m'; $str = '{1|{1078} {*|{1079}-}test{1|{4829}, test2 {4457}}} {*|{1078} {*|{1079}-}test3{1|{4829}, test4 {23232}}} '; preg_match_all($re, $str, $matches); rsort($matches[0]); echo implode(',', array_unique($matches[0]));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kmCKU
function name:  (null)
number of ops:  21
compiled vars:  !0 = $re, !1 = $str, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%5C%7C%7B%5CK%5Cd%2B%28%3F%3D%7D%29%2Fm'
    4     1        ASSIGN                                                   !1, '%7B1%7C%7B1078%7D+%7B%2A%7C%7B1079%7D-%7Dtest%7B1%7C%7B4829%7D%2C+test2+%7B4457%7D%7D%7D+%7B%2A%7C%7B1078%7D+%7B%2A%7C%7B1079%7D-%7Dtest3%7B1%7C%7B4829%7D%2C+test4+%7B23232%7D%7D%7D%0A'
    6     2        INIT_FCALL                                               'preg_match_all'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        SEND_REF                                                 !2
          6        DO_ICALL                                                 
    7     7        INIT_FCALL                                               'rsort'
          8        FETCH_DIM_W                                      $6      !2, 0
          9        SEND_REF                                                 $6
         10        DO_ICALL                                                 
    8    11        INIT_FCALL                                               'implode'
         12        SEND_VAL                                                 '%2C'
         13        INIT_FCALL                                               'array_unique'
         14        FETCH_DIM_R                                      ~8      !2, 0
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                         $9      
         17        SEND_VAR                                                 $9
         18        DO_ICALL                                         $10     
         19        ECHO                                                     $10
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.18 ms | 1013 KiB | 17 Q