3v4l.org

run code in 500+ 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 = 9, Position 2 = 20
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
filename:       /in/n9tRk
function name:  (null)
number of ops:  24
compiled vars:  !0 = $foo, !1 = $items, !2 = $matches
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   FRAMELESS_ICALL_1                trim                ~3      '%0A%7B555555++123456++123456%7D%0A%7B666666++654321++654321%7D%0A%7B777777++123456++123456%7D%0A'
          1        ASSIGN                                                       !0, ~3
    9     2        ASSIGN                                                       !1, <array>
   11     3        INIT_FCALL                                                   'preg_match_all'
          4        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'
          5        SEND_VAR                                                     !0
          6        SEND_REF                                                     !2
          7        DO_ICALL                                             $6      
          8      > JMPZ                                                         $6, ->20
   12     9    >   INIT_FCALL                                                   'array_reduce'
   13    10        INIT_FCALL                                                   'array_slice'
         11        SEND_VAR                                                     !2
         12        SEND_VAL                                                     1
         13        DO_ICALL                                             $7      
         14        SEND_VAR                                                     $7
   14    15        DECLARE_LAMBDA_FUNCTION                              ~8      [0]
         16        SEND_VAL                                                     ~8
   15    17        SEND_VAL                                                     <array>
   12    18        DO_ICALL                                             $9      
         19        ASSIGN                                                       !1, $9
   19    20    >   INIT_FCALL                                                   'var_dump'
         21        SEND_VAR                                                     !1
         22        DO_ICALL                                                     
         23      > 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:/in/n9tRk:14}
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.5.0


preferences:
167.02 ms | 1891 KiB | 18 Q