3v4l.org

run code in 300+ PHP versions simultaneously
<?php $description = 'some text {PID =340} {PID =357}'; echo implode(',', preg_match_all('~\{PID =\K\d+~', $description, $out) ? $out[0] : []);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WalUc
function name:  (null)
number of ops:  17
compiled vars:  !0 = $description, !1 = $out
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'some+text+%7BPID+%3D340%7D++%7BPID+%3D357%7D'
    3     1        INIT_FCALL                                               'implode'
          2        SEND_VAL                                                 '%2C'
          3        INIT_FCALL                                               'preg_match_all'
          4        SEND_VAL                                                 '%7E%5C%7BPID+%3D%5CK%5Cd%2B%7E'
          5        SEND_VAR                                                 !0
          6        SEND_REF                                                 !1
          7        DO_ICALL                                         $3      
          8      > JMPZ                                                     $3, ->12
          9    >   FETCH_DIM_R                                      ~4      !1, 0
         10        QM_ASSIGN                                        ~5      ~4
         11      > JMP                                                      ->13
         12    >   QM_ASSIGN                                        ~5      <array>
         13    >   SEND_VAL                                                 ~5
         14        DO_ICALL                                         $6      
         15        ECHO                                                     $6
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.25 ms | 998 KiB | 15 Q