3v4l.org

run code in 300+ PHP versions simultaneously
<?php $txt= ["1 Dead Revels [RNA]", "7 Final Payment [RNA]", "1 Ob Nixilis's Cruelty [WAR]", "1 Aid the Fallen [WAR]", "13 Makeshift Battalion [WAR]", "1 Sunblade Angel [WAR]", "34 Trusted Pegasus [WAR]", "1 Orzhov Racketeers [RNA]", "1 Wanderer's Strike [WAR]", "1 Reya Dawnbringer [UMA]", "4 Expansion // Explosion [GRN]"]; foreach ($txt as $buffer) { if (preg_match('~([0-9]+)\s+(.*?)\s*\[([^][]+)]~', $buffer, $matches)) { print_r(array_slice($matches, 1)); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/CLNBs
function name:  (null)
number of ops:  19
compiled vars:  !0 = $txt, !1 = $buffer, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1      > FE_RESET_R                                       $4      !0, ->17
          2    > > FE_FETCH_R                                               $4, !1, ->17
   16     3    >   INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%7E%28%5B0-9%5D%2B%29%5Cs%2B%28.%2A%3F%29%5Cs%2A%5C%5B%28%5B%5E%5D%5B%5D%2B%29%5D%7E'
          5        SEND_VAR                                                 !1
          6        SEND_REF                                                 !2
          7        DO_ICALL                                         $5      
          8      > JMPZ                                                     $5, ->16
   17     9    >   INIT_FCALL                                               'print_r'
         10        INIT_FCALL                                               'array_slice'
         11        SEND_VAR                                                 !2
         12        SEND_VAL                                                 1
         13        DO_ICALL                                         $6      
         14        SEND_VAR                                                 $6
         15        DO_ICALL                                                 
   15    16    > > JMP                                                      ->2
         17    >   FE_FREE                                                  $4
   19    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.23 ms | 999 KiB | 16 Q