3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = trim(' {555555 123456 123456} {666666 654321 654321} {777777 123456 123456} '); $items = []; if (preg_match_all('/^{[\d]{1,} ([\d]{1,}) ([\d]{1,})}$/m', $foo, $matches)) { $items = array_reduce( array_slice($matches, 1), fn(array $found, array $match) => array_merge($found, $match), [] ); } var_dump($items);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/n9tRk
function name:  (null)
number of ops:  26
compiled vars:  !0 = $foo, !1 = $items, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'trim'
          1        SEND_VAL                                                 '%0A%7B555555++123456++123456%7D%0A%7B666666++654321++654321%7D%0A%7B777777++123456++123456%7D%0A'
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
    9     4        ASSIGN                                                   !1, <array>
   11     5        INIT_FCALL                                               'preg_match_all'
          6        SEND_VAL                                                 '%2F%5E%7B%5B%5Cd%5D%7B1%2C%7D++%28%5B%5Cd%5D%7B1%2C%7D%29++%28%5B%5Cd%5D%7B1%2C%7D%29%7D%24%2Fm'
          7        SEND_VAR                                                 !0
          8        SEND_REF                                                 !2
          9        DO_ICALL                                         $6      
         10      > JMPZ                                                     $6, ->22
   12    11    >   INIT_FCALL                                               'array_reduce'
   13    12        INIT_FCALL                                               'array_slice'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 1
         15        DO_ICALL                                         $7      
         16        SEND_VAR                                                 $7
   14    17        DECLARE_LAMBDA_FUNCTION                          ~8      [0]
         18        SEND_VAL                                                 ~8
   15    19        SEND_VAL                                                 <array>
   12    20        DO_ICALL                                         $9      
         21        ASSIGN                                                   !1, $9
   19    22    >   INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
         25      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/n9tRk
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $found, !1 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        INIT_FCALL                                               'array_merge'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > RETURN                                                   $2
          7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.51 ms | 1020 KiB | 19 Q