3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "00 a 51 - a9"; $numbers = ""; $chars = ""; preg_match("/(\d*)(\D*)/", $string, $matches); print_r($matches); foreach($matches[1] as $match) { $numbers .= is_int($match) ? $match : ''; } foreach($matches[2] as $match) { $chars .= !is_int($match) ? $match : ''; } var_dump($numbers); echo " "; var_dump($chars);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 21
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 21
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 24, Position 2 = 33
Branch analysis from position: 24
2 jumps found. (Code = 78) Position 1 = 25, Position 2 = 33
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 30
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 31
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
Branch analysis from position: 21
filename:       /in/RECbB
function name:  (null)
number of ops:  42
compiled vars:  !0 = $string, !1 = $numbers, !2 = $chars, !3 = $matches, !4 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '00+a+51+-+a9'
    3     1        ASSIGN                                                   !1, ''
    4     2        ASSIGN                                                   !2, ''
    6     3        INIT_FCALL                                               'preg_match'
          4        SEND_VAL                                                 '%2F%28%5Cd%2A%29%28%5CD%2A%29%2F'
          5        SEND_VAR                                                 !0
          6        SEND_REF                                                 !3
          7        DO_ICALL                                                 
    7     8        INIT_FCALL                                               'print_r'
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                                 
    9    11        FETCH_DIM_R                                      ~10     !3, 1
         12      > FE_RESET_R                                       $11     ~10, ->21
         13    > > FE_FETCH_R                                               $11, !4, ->21
   10    14    >   TYPE_CHECK                                   16          !4
         15      > JMPZ                                                     ~12, ->18
         16    >   QM_ASSIGN                                        ~13     !4
         17      > JMP                                                      ->19
         18    >   QM_ASSIGN                                        ~13     ''
         19    >   ASSIGN_OP                                     8          !1, ~13
    9    20      > JMP                                                      ->13
         21    >   FE_FREE                                                  $11
   13    22        FETCH_DIM_R                                      ~15     !3, 2
         23      > FE_RESET_R                                       $16     ~15, ->33
         24    > > FE_FETCH_R                                               $16, !4, ->33
   14    25    >   TYPE_CHECK                                   16  ~17     !4
         26        BOOL_NOT                                         ~18     ~17
         27      > JMPZ                                                     ~18, ->30
         28    >   QM_ASSIGN                                        ~19     !4
         29      > JMP                                                      ->31
         30    >   QM_ASSIGN                                        ~19     ''
         31    >   ASSIGN_OP                                     8          !2, ~19
   13    32      > JMP                                                      ->24
         33    >   FE_FREE                                                  $16
   17    34        INIT_FCALL                                               'var_dump'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                                 
   18    37        ECHO                                                     '+'
   19    38        INIT_FCALL                                               'var_dump'
         39        SEND_VAR                                                 !2
         40        DO_ICALL                                                 
         41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.44 ms | 1400 KiB | 19 Q